[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 15/154: iAdd headerfile for mhd_send.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 15/154: iAdd headerfile for mhd_send. |
Date: |
Mon, 19 Aug 2019 10:15:27 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit ee0942b2e0ea1683d9329f45cc81b193908672ec
Author: ng0 <address@hidden>
AuthorDate: Tue Jun 25 14:05:12 2019 +0000
iAdd headerfile for mhd_send.
---
src/microhttpd/Makefile.am | 2 +-
src/microhttpd/mhd_send.c | 26 +----------------
src/microhttpd/mhd_send.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+), 26 deletions(-)
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am
index 452e8971..7a484371 100644
--- a/src/microhttpd/Makefile.am
+++ b/src/microhttpd/Makefile.am
@@ -62,7 +62,7 @@ libmicrohttpd_la_SOURCES = \
mhd_limits.h mhd_byteorder.h \
sysfdsetsize.c sysfdsetsize.h \
mhd_str.c mhd_str.h \
- mhd_send.c \
+ mhd_send.h mhd_send.c \
mhd_assert.h \
mhd_sockets.c mhd_sockets.h \
mhd_itc.c mhd_itc.h mhd_itc_types.h \
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index c3724cba..50013c13 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -29,14 +29,7 @@
// are used.
// TODO: sendfile() wrappers.
-#include "platform.h"
-#include "internal.h"
-
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#endif
-#include <errno.h>
-
+#include "mhd_send.h"
// NOTE: TCP_CORK == TCP_NOPUSH in FreeBSD.
// TCP_CORK is Linux.
@@ -47,23 +40,6 @@
// the linked library needs a different setsockopt usage:
//
https://stackoverflow.com/questions/48670299/setsockopt-usage-in-linux-and-solaris-invalid-argument-in-solaris
-enum MHD_SendSocketOptions
-{
- /* definitely no corking (use NODELAY, or explicitly disable cork) */
- MHD_SSO_NO_CORK = 0,
- /* should enable corking (use MSG_MORE, or explicitly enable cork) */
- MHD_SSO_MAY_CORK = 1,
- /*
- * consider tcpi_snd_mss and consider not corking for the header
- * part if the size of the header is close to the MSS.
- * Only used if we are NOT doing 100 Continue and are still
- * sending the header (provided in full as the buffer to
- * MHD_send_on_connection_ or as the header to
- * MHD_send_on_connection2_).
- */
- MHD_SSO_HDR_CORK = 2
-};
-
/*
*
https://svnweb.freebsd.org/base/head/sys/netinet/tcp_usrreq.c?view=markup&pathrev=346360
* Approximately in 2007 work began to make TCP_NOPUSH in FreeBSD
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 @@
+/*
+ This file is part of libmicrohttpd
+ Copyright (C) 2019 ng0
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+
+*/
+
+/**
+ * @file mhd_send.h
+ * @brief Implementation of send() wrappers.
+ * @author ng0
+ */
+
+#ifndef MHD_SEND_H
+#define MHD_SEND_H
+
+#include "platform.h"
+#include "internal.h"
+
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#endif /* HAVE_STDBOOL_H */
+
+#include <errno.h>
+
+enum MHD_SendSocketOptions
+{
+ /* definitely no corking (use NODELAY, or explicitly disable cork) */
+ MHD_SSO_NO_CORK = 0,
+ /* should enable corking (use MSG_MORE, or explicitly enable cork) */
+ MHD_SSO_MAY_CORK = 1,
+ /*
+ * consider tcpi_snd_mss and consider not corking for the header
+ * part if the size of the header is close to the MSS.
+ * Only used if we are NOT doing 100 Continue and are still
+ * sending the header (provided in full as the buffer to
+ * MHD_send_on_connection_ or as the header to
+ * MHD_send_on_connection2_).
+ */
+ MHD_SSO_HDR_CORK = 2
+};
+
+
+ssize_t
+MHD_send_on_connection_ (struct MHD_Connection *connection,
+ const char *buffer,
+ size_t buffer_size,
+ enum MHD_SendSocketOptions options);
+
+ssize_t
+MHD_send_on_connection2_ (struct MHD_Connection *connection,
+ const char *header,
+ size_t header_size,
+ const char *buffer,
+ size_t buffer_size);
+
+#endif /* MHD_SEND_H */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 24/154: move TLS branch to right position, (continued)
- [GNUnet-SVN] [libmicrohttpd] 24/154: move TLS branch to right position, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 37/154: flatten if statements, add initial TCP_NOPUSH to MHD_send_on_connection2_, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 39/154: indent, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 33/154: replace connection->send_cls(), gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 13/154: mhd_send.c: fix compiler error about MSG_MORE when MSG_MORE is undefined., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 18/154: more from connection.c, without checks so far., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 16/154: mhd_send: Use MHD_SCKT_OPT_BOOL_ for setsockopt optval., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 28/154: fixes, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 43/154: move comment above function., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 25/154: inline TLS logic, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 15/154: iAdd headerfile for mhd_send.,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 26/154: indentation, comments, issue, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 29/154: fix err logic, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 10/154: mhd_send: Restructure., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 27/154: fixes, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 32/154: setsockopt(): check return value., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 21/154: mhd_send.c: Use daemon from connection struct., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 45/154: fix compiler error., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 44/154: remove verbose comments in mhd_send.c, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 55/154: doxygen: MHD_SSO, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 30/154: comments, gnunet, 2019/08/19