diff options
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index b287a222..d4d77fea 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -266,6 +266,40 @@ MHD_create_response_from_callback (uint64_t size, | |||
266 | 266 | ||
267 | 267 | ||
268 | /** | 268 | /** |
269 | * Set special flags and options for a response. | ||
270 | * | ||
271 | * @param response the response to modify | ||
272 | * @param flags to set for the response | ||
273 | * @param ... #MHD_RO_END terminated list of options | ||
274 | * @return #MHD_YES on success, #MHD_NO on error | ||
275 | */ | ||
276 | int | ||
277 | MHD_set_response_options (struct MHD_Response *response, | ||
278 | enum MHD_ResponseFlags flags, | ||
279 | ...) | ||
280 | { | ||
281 | va_list ap; | ||
282 | int ret; | ||
283 | enum MHD_ResponseOptions ro; | ||
284 | |||
285 | ret = MHD_YES; | ||
286 | response->flags = flags; | ||
287 | va_start (ap, flags); | ||
288 | while (MHD_RO_END != (ro = va_arg (ap, enum MHD_ResponseOptions))) | ||
289 | { | ||
290 | switch (ro) | ||
291 | { | ||
292 | default: | ||
293 | ret = MHD_NO; | ||
294 | break; | ||
295 | } | ||
296 | } | ||
297 | va_end (ap); | ||
298 | return ret; | ||
299 | } | ||
300 | |||
301 | |||
302 | /** | ||
269 | * Given a file descriptor, read data from the file | 303 | * Given a file descriptor, read data from the file |
270 | * to generate the response. | 304 | * to generate the response. |
271 | * | 305 | * |