diff options
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r-- | src/microhttpd/internal.h | 145 |
1 files changed, 78 insertions, 67 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 863def56..d6f1177c 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -102,68 +102,68 @@ extern void *mhd_panic_cls; | |||
102 | * State of the socket with respect to epoll (bitmask). | 102 | * State of the socket with respect to epoll (bitmask). |
103 | */ | 103 | */ |
104 | enum MHD_EpollState | 104 | enum MHD_EpollState |
105 | { | 105 | { |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * The socket is not involved with a defined state in epoll() right | 108 | * The socket is not involved with a defined state in epoll() right |
109 | * now. | 109 | * now. |
110 | */ | 110 | */ |
111 | MHD_EPOLL_STATE_UNREADY = 0, | 111 | MHD_EPOLL_STATE_UNREADY = 0, |
112 | 112 | ||
113 | /** | 113 | /** |
114 | * epoll() told us that data was ready for reading, and we did | 114 | * epoll() told us that data was ready for reading, and we did |
115 | * not consume all of it yet. | 115 | * not consume all of it yet. |
116 | */ | 116 | */ |
117 | MHD_EPOLL_STATE_READ_READY = 1, | 117 | MHD_EPOLL_STATE_READ_READY = 1, |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * epoll() told us that space was available for writing, and we did | 120 | * epoll() told us that space was available for writing, and we did |
121 | * not consume all of it yet. | 121 | * not consume all of it yet. |
122 | */ | 122 | */ |
123 | MHD_EPOLL_STATE_WRITE_READY = 2, | 123 | MHD_EPOLL_STATE_WRITE_READY = 2, |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * Is this connection currently in the 'eready' EDLL? | 126 | * Is this connection currently in the 'eready' EDLL? |
127 | */ | 127 | */ |
128 | MHD_EPOLL_STATE_IN_EREADY_EDLL = 4, | 128 | MHD_EPOLL_STATE_IN_EREADY_EDLL = 4, |
129 | 129 | ||
130 | /** | 130 | /** |
131 | * Is this connection currently in the epoll() set? | 131 | * Is this connection currently in the epoll() set? |
132 | */ | 132 | */ |
133 | MHD_EPOLL_STATE_IN_EPOLL_SET = 8, | 133 | MHD_EPOLL_STATE_IN_EPOLL_SET = 8, |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * Is this connection currently suspended? | 136 | * Is this connection currently suspended? |
137 | */ | 137 | */ |
138 | MHD_EPOLL_STATE_SUSPENDED = 16 | 138 | MHD_EPOLL_STATE_SUSPENDED = 16 |
139 | }; | 139 | }; |
140 | 140 | ||
141 | 141 | ||
142 | /** | 142 | /** |
143 | * What is this connection waiting for? | 143 | * What is this connection waiting for? |
144 | */ | 144 | */ |
145 | enum MHD_ConnectionEventLoopInfo | 145 | enum MHD_ConnectionEventLoopInfo |
146 | { | 146 | { |
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 = 0, |
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 = 1, |
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 = 2, |
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 = 3 |
166 | }; | 166 | }; |
167 | 167 | ||
168 | 168 | ||
169 | /** | 169 | /** |
@@ -202,7 +202,8 @@ struct MHD_NonceNc | |||
202 | */ | 202 | */ |
203 | void | 203 | void |
204 | MHD_DLOG (const struct MHD_Daemon *daemon, | 204 | MHD_DLOG (const struct MHD_Daemon *daemon, |
205 | const char *format, ...); | 205 | const char *format, |
206 | ...); | ||
206 | #endif | 207 | #endif |
207 | 208 | ||
208 | 209 | ||
@@ -273,6 +274,20 @@ struct MHD_Response | |||
273 | */ | 274 | */ |
274 | MHD_ContentReaderFreeCallback crfc; | 275 | MHD_ContentReaderFreeCallback crfc; |
275 | 276 | ||
277 | #if 0 | ||
278 | /** | ||
279 | * Application function to call once we are done sending the headers | ||
280 | * of the response; NULL unless this is a response created with | ||
281 | * #MHD_create_response_for_upgrade(). | ||
282 | */ | ||
283 | MHD_UpgradeHandler upgrade_handler; | ||
284 | |||
285 | /** | ||
286 | * Closure for @e uh. | ||
287 | */ | ||
288 | void *upgrade_handler_cls; | ||
289 | #endif | ||
290 | |||
276 | /** | 291 | /** |
277 | * Mutex to synchronize access to @e data, @e size and | 292 | * Mutex to synchronize access to @e data, @e size and |
278 | * @e reference_count. | 293 | * @e reference_count. |
@@ -569,14 +584,12 @@ struct MHD_Connection | |||
569 | struct MHD_Response *response; | 584 | struct MHD_Response *response; |
570 | 585 | ||
571 | /** | 586 | /** |
572 | * The memory pool is created whenever we first read | 587 | * The memory pool is created whenever we first read from the TCP |
573 | * from the TCP stream and destroyed at the end of | 588 | * stream and destroyed at the end of each request (and re-created |
574 | * each request (and re-created for the next request). | 589 | * for the next request). In the meantime, this pointer is NULL. |
575 | * In the meantime, this pointer is NULL. The | 590 | * The pool is used for all connection-related data except for the |
576 | * pool is used for all connection-related data | 591 | * response (which maybe shared between connections) and the IP |
577 | * except for the response (which maybe shared between | 592 | * address (which persists across individual requests). |
578 | * connections) and the IP address (which persists | ||
579 | * across individual requests). | ||
580 | */ | 593 | */ |
581 | struct MemoryPool *pool; | 594 | struct MemoryPool *pool; |
582 | 595 | ||
@@ -598,8 +611,7 @@ struct MHD_Connection | |||
598 | void *socket_context; | 611 | void *socket_context; |
599 | 612 | ||
600 | /** | 613 | /** |
601 | * Request method. Should be GET/POST/etc. Allocated | 614 | * Request method. Should be GET/POST/etc. Allocated in pool. |
602 | * in pool. | ||
603 | */ | 615 | */ |
604 | char *method; | 616 | char *method; |
605 | 617 | ||
@@ -616,9 +628,8 @@ struct MHD_Connection | |||
616 | char *version; | 628 | char *version; |
617 | 629 | ||
618 | /** | 630 | /** |
619 | * Buffer for reading requests. Allocated | 631 | * Buffer for reading requests. Allocated in pool. Actually one |
620 | * in pool. Actually one byte larger than | 632 | * byte larger than @e read_buffer_size (if non-NULL) to allow for |
621 | * @e read_buffer_size (if non-NULL) to allow for | ||
622 | * 0-termination. | 633 | * 0-termination. |
623 | */ | 634 | */ |
624 | char *read_buffer; | 635 | char *read_buffer; |