aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_send.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_send.h')
-rw-r--r--src/microhttpd/mhd_send.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/microhttpd/mhd_send.h b/src/microhttpd/mhd_send.h
new file mode 100644
index 00000000..2ff39a05
--- /dev/null
+++ b/src/microhttpd/mhd_send.h
@@ -0,0 +1,70 @@
1/*
2 This file is part of libmicrohttpd
3 Copyright (C) 2019 ng0
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/**
22 * @file mhd_send.h
23 * @brief Implementation of send() wrappers.
24 * @author ng0
25 */
26
27#ifndef MHD_SEND_H
28#define MHD_SEND_H
29
30#include "platform.h"
31#include "internal.h"
32
33#if defined(HAVE_STDBOOL_H)
34#include <stdbool.h>
35#endif /* HAVE_STDBOOL_H */
36
37#include <errno.h>
38
39enum MHD_SendSocketOptions
40{
41 /* definitely no corking (use NODELAY, or explicitly disable cork) */
42 MHD_SSO_NO_CORK = 0,
43 /* should enable corking (use MSG_MORE, or explicitly enable cork) */
44 MHD_SSO_MAY_CORK = 1,
45 /*
46 * consider tcpi_snd_mss and consider not corking for the header
47 * part if the size of the header is close to the MSS.
48 * Only used if we are NOT doing 100 Continue and are still
49 * sending the header (provided in full as the buffer to
50 * MHD_send_on_connection_ or as the header to
51 * MHD_send_on_connection2_).
52 */
53 MHD_SSO_HDR_CORK = 2
54};
55
56
57ssize_t
58MHD_send_on_connection_ (struct MHD_Connection *connection,
59 const char *buffer,
60 size_t buffer_size,
61 enum MHD_SendSocketOptions options);
62
63ssize_t
64MHD_send_on_connection2_ (struct MHD_Connection *connection,
65 const char *header,
66 size_t header_size,
67 const char *buffer,
68 size_t buffer_size);
69
70#endif /* MHD_SEND_H */