aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-13 07:46:29 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-13 07:46:29 +0000
commit1e2bfba0914a0e85a736552f813875a8415c46dc (patch)
treea537f5ea68c42621afb1812783827d61df516613
parenta8541b843eb578608d7822f40be0f828838240e3 (diff)
downloadlibmicrohttpd-1e2bfba0914a0e85a736552f813875a8415c46dc.tar.gz
libmicrohttpd-1e2bfba0914a0e85a736552f813875a8415c46dc.zip
stuff
-rw-r--r--src/daemon/connection.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index ec300627..2a7fb261 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -104,9 +104,12 @@
104 */ 104 */
105#define DEBUG_SEND_DATA MHD_NO 105#define DEBUG_SEND_DATA MHD_NO
106 106
107
107/** 108/**
108 * Get all of the headers from the request. 109 * Get all of the headers from the request.
109 * 110 *
111 * @param connection connection to get values from
112 * @param kind types of values to iterate over
110 * @param iterator callback to call on each header; 113 * @param iterator callback to call on each header;
111 * maybe NULL (then just count headers) 114 * maybe NULL (then just count headers)
112 * @param iterator_cls extra argument to iterator 115 * @param iterator_cls extra argument to iterator
@@ -139,6 +142,7 @@ MHD_get_connection_values (struct MHD_Connection *connection,
139 return ret; 142 return ret;
140} 143}
141 144
145
142/** 146/**
143 * This function can be used to add an entry to 147 * This function can be used to add an entry to
144 * the HTTP headers of a connection (so that the 148 * the HTTP headers of a connection (so that the
@@ -187,10 +191,13 @@ MHD_set_connection_value (struct MHD_Connection *connection,
187 return MHD_YES; 191 return MHD_YES;
188} 192}
189 193
194
190/** 195/**
191 * Get a particular header value. If multiple 196 * Get a particular header value. If multiple
192 * values match the kind, return any one of them. 197 * values match the kind, return any one of them.
193 * 198 *
199 * @param connection connection to get values from
200 * @param kind what kind of value are we looking for
194 * @param key the header to look for 201 * @param key the header to look for
195 * @return NULL if no such item was found 202 * @return NULL if no such item was found
196 */ 203 */
@@ -212,6 +219,7 @@ MHD_lookup_connection_value (struct MHD_Connection *connection,
212 return NULL; 219 return NULL;
213} 220}
214 221
222
215/** 223/**
216 * Queue a response to be transmitted to the client (as soon as 224 * Queue a response to be transmitted to the client (as soon as
217 * possible but after MHD_AccessHandlerCallback returns). 225 * possible but after MHD_AccessHandlerCallback returns).
@@ -254,9 +262,13 @@ MHD_queue_response (struct MHD_Connection *connection,
254 return MHD_YES; 262 return MHD_YES;
255} 263}
256 264
265
257/** 266/**
258 * Do we (still) need to send a 100 continue 267 * Do we (still) need to send a 100 continue
259 * message for this connection? 268 * message for this connection?
269 *
270 * @param connection connection to test
271 * @return 0 if we don't need 100 CONTINUE, 1 if we do
260 */ 272 */
261static int 273static int
262need_100_continue (struct MHD_Connection *connection) 274need_100_continue (struct MHD_Connection *connection)
@@ -279,6 +291,9 @@ need_100_continue (struct MHD_Connection *connection)
279/** 291/**
280 * Close the given connection and give the 292 * Close the given connection and give the
281 * specified termination code to the user. 293 * specified termination code to the user.
294 *
295 * @param connection connection to close
296 * @param termination_code termination reason to give
282 */ 297 */
283void 298void
284MHD_connection_close (struct MHD_Connection *connection, 299MHD_connection_close (struct MHD_Connection *connection,
@@ -296,6 +311,11 @@ MHD_connection_close (struct MHD_Connection *connection,
296 &connection->client_context, 311 &connection->client_context,
297 termination_code); 312 termination_code);
298 connection->client_aware = MHD_NO; 313 connection->client_aware = MHD_NO;
314 if (pos->response != NULL)
315 {
316 MHD_destroy_response (pos->response);
317 pos->response = NULL;
318 }
299} 319}
300 320
301 321