aboutsummaryrefslogtreecommitdiff
path: root/src/lib/response_options.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/response_options.c')
-rw-r--r--src/lib/response_options.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/lib/response_options.c b/src/lib/response_options.c
new file mode 100644
index 00000000..406d1d32
--- /dev/null
+++ b/src/lib/response_options.c
@@ -0,0 +1,61 @@
1/*
2 This file is part of libmicrohttpd
3 Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
20/**
21 * @file lib/response_option.c
22 * @brief implementation of response options
23 * @author Christian Grothoff
24 */
25#include "internal.h"
26
27
28/**
29 * Only respond in conservative HTTP 1.0-mode. In
30 * particular, do not (automatically) sent "Connection" headers and
31 * always close the connection after generating the response.
32 *
33 * @param request the request for which we force HTTP 1.0 to be used
34 */
35void
36MHD_response_option_v10_only (struct MHD_Response *response)
37{
38 response->v10_only = true;
39}
40
41
42/**
43 * Set a function to be called once MHD is finished with the
44 * request.
45 *
46 * @param response which response to set the callback for
47 * @param termination_cb function to call
48 * @param termination_cb_cls closure for @e termination_cb
49 */
50void
51MHD_response_option_termination_callback (struct MHD_Response *response,
52 MHD_RequestTerminationCallback termination_cb,
53 void *termination_cb_cls)
54{
55 /* Q: should we assert termination_cb non-NULL? */
56 response->termination_cb = termination_cb;
57 response->termination_cb_cls = termination_cb_cls;
58}
59
60
61/* end of response_option.c */