diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-08-28 08:41:46 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-08-28 08:41:46 +0000 |
commit | fd7feaf9161ae725d3dab83794b60d56d02be735 (patch) | |
tree | 943b2ca7bb30975685076ef1f5fa373e8710d39f | |
parent | 11171dc8c5741387a165bcf4f909c9c7af6e270e (diff) | |
download | libmicrohttpd-fd7feaf9161ae725d3dab83794b60d56d02be735.tar.gz libmicrohttpd-fd7feaf9161ae725d3dab83794b60d56d02be735.zip |
-fix ftbfs
-rw-r--r-- | src/microhttpd/internal.h | 58 | ||||
-rw-r--r-- | src/microhttpd/response.c | 32 |
2 files changed, 56 insertions, 34 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index a810d319..c1524330 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -147,22 +147,22 @@ enum MHD_ConnectionEventLoopInfo | |||
147 | /** | 147 | /** |
148 | * We are waiting to be able to read. | 148 | * We are waiting to be able to read. |
149 | */ | 149 | */ |
150 | MHD_EVENT_LOOP_INFO_READ = 0, | 150 | MHD_EVENT_LOOP_INFO_READ = 1, |
151 | 151 | ||
152 | /** | 152 | /** |
153 | * We are waiting to be able to write. | 153 | * We are waiting to be able to write. |
154 | */ | 154 | */ |
155 | MHD_EVENT_LOOP_INFO_WRITE = 1, | 155 | MHD_EVENT_LOOP_INFO_WRITE = 2, |
156 | 156 | ||
157 | /** | 157 | /** |
158 | * We are waiting for the application to provide data. | 158 | * We are waiting for the application to provide data. |
159 | */ | 159 | */ |
160 | MHD_EVENT_LOOP_INFO_BLOCK = 2, | 160 | MHD_EVENT_LOOP_INFO_BLOCK = 4, |
161 | 161 | ||
162 | /** | 162 | /** |
163 | * We are finished and are awaiting cleanup. | 163 | * We are finished and are awaiting cleanup. |
164 | */ | 164 | */ |
165 | MHD_EVENT_LOOP_INFO_CLEANUP = 3 | 165 | MHD_EVENT_LOOP_INFO_CLEANUP = 8 |
166 | }; | 166 | }; |
167 | 167 | ||
168 | 168 | ||
@@ -886,6 +886,56 @@ struct MHD_Connection | |||
886 | int resuming; | 886 | int resuming; |
887 | }; | 887 | }; |
888 | 888 | ||
889 | |||
890 | /** | ||
891 | * Handle given to the application to manage special | ||
892 | * actions relating to MHD responses that "upgrade" | ||
893 | * the HTTP protocol (i.e. to WebSockets). | ||
894 | */ | ||
895 | struct MHD_UpgradeResponseHandle | ||
896 | { | ||
897 | |||
898 | /** | ||
899 | * Kept in a DLL per daemon. | ||
900 | */ | ||
901 | struct MHD_UpgradeResponseHandle *next; | ||
902 | |||
903 | /** | ||
904 | * Kept in a DLL per daemon. | ||
905 | */ | ||
906 | struct MHD_UpgradeResponseHandle *prev; | ||
907 | |||
908 | /** | ||
909 | * The connection for which this is an upgrade handle. Note that | ||
910 | * because a response may be shared over many connections, this may | ||
911 | * not be the only upgrade handle for the response of this connection. | ||
912 | */ | ||
913 | struct MHD_Connection *connection; | ||
914 | |||
915 | /** | ||
916 | * The socket we gave to the application (r/w). | ||
917 | */ | ||
918 | MHD_socket app_socket; | ||
919 | |||
920 | /** | ||
921 | * IO-state of the @e app_socket. | ||
922 | */ | ||
923 | enum MHD_ConnectionEventLoopInfo celi_app; | ||
924 | |||
925 | /** | ||
926 | * If @a app_sock was a socketpair, our end of it, otherwise | ||
927 | * #MHD_INVALID_SOCKET; (r/w). | ||
928 | */ | ||
929 | MHD_socket mhd_socket; | ||
930 | |||
931 | /** | ||
932 | * IO-state of the @e mhd_socket. | ||
933 | */ | ||
934 | enum MHD_ConnectionEventLoopInfo celi_mhd; | ||
935 | |||
936 | }; | ||
937 | |||
938 | |||
889 | /** | 939 | /** |
890 | * Signature of function called to log URI accesses. | 940 | * Signature of function called to log URI accesses. |
891 | * | 941 | * |
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 9336aa91..e7049a5a 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -581,35 +581,6 @@ MHD_create_response_from_buffer (size_t size, | |||
581 | 581 | ||
582 | 582 | ||
583 | /** | 583 | /** |
584 | * Handle given to the application to manage special | ||
585 | * actions relating to MHD responses that "upgrade" | ||
586 | * the HTTP protocol (i.e. to WebSockets). | ||
587 | */ | ||
588 | struct MHD_UpgradeResponseHandle | ||
589 | { | ||
590 | |||
591 | /** | ||
592 | * The connection for which this is an upgrade handle. Note that | ||
593 | * because a response may be shared over many connections, this may | ||
594 | * not be the only upgrade handle for the response of this connection. | ||
595 | */ | ||
596 | struct MHD_Connection *connection; | ||
597 | |||
598 | /** | ||
599 | * The socket we gave to the application (r/w). | ||
600 | */ | ||
601 | MHD_socket app_socket; | ||
602 | |||
603 | /** | ||
604 | * If @a app_sock was a socketpair, our end of it, otherwise | ||
605 | * #MHD_INVALID_SOCKET; (r/w). | ||
606 | */ | ||
607 | MHD_socket mhd_socket; | ||
608 | |||
609 | }; | ||
610 | |||
611 | |||
612 | /** | ||
613 | * This connection-specific callback is provided by MHD to | 584 | * This connection-specific callback is provided by MHD to |
614 | * applications (unusual) during the #MHD_UpgradeHandler. | 585 | * applications (unusual) during the #MHD_UpgradeHandler. |
615 | * It allows applications to perform 'special' actions on | 586 | * It allows applications to perform 'special' actions on |
@@ -702,7 +673,7 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
702 | connection->read_buffer_offset = 0; | 673 | connection->read_buffer_offset = 0; |
703 | response->upgrade_handler (response->upgrade_handler_cls, | 674 | response->upgrade_handler (response->upgrade_handler_cls, |
704 | connection, | 675 | connection, |
705 | connection->con_cls, | 676 | connection->client_context, |
706 | connection->read_buffer, | 677 | connection->read_buffer, |
707 | rbo, | 678 | rbo, |
708 | urh->app_socket, | 679 | urh->app_socket, |
@@ -723,6 +694,7 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
723 | connection->read_buffer_offset = 0; | 694 | connection->read_buffer_offset = 0; |
724 | response->upgrade_handler (response->upgrade_handler_cls, | 695 | response->upgrade_handler (response->upgrade_handler_cls, |
725 | connection, | 696 | connection, |
697 | connection->client_context, | ||
726 | connection->read_buffer, | 698 | connection->read_buffer, |
727 | rbo, | 699 | rbo, |
728 | connection->socket_fd, | 700 | connection->socket_fd, |