aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-07-30 08:31:41 +0000
committerng0 <ng0@n0.is>2019-07-30 08:31:41 +0000
commit5b83823ef36d4fe43094dd72969adf0fc68d7e64 (patch)
tree829d7fd6db8c62b6553623d644220f746b9ff64b
parent57054d044880168615e380fc9ab0f37563020019 (diff)
downloadlibmicrohttpd-5b83823ef36d4fe43094dd72969adf0fc68d7e64.tar.gz
libmicrohttpd-5b83823ef36d4fe43094dd72969adf0fc68d7e64.zip
Add MSG_MORE detection.
-rw-r--r--configure.ac21
-rw-r--r--src/microhttpd/mhd_send.c6
2 files changed, 24 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 49bcd624..4d6e263c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -644,9 +644,30 @@ AM_CONDITIONAL([HAVE_LISTEN_SHUTDOWN], [test "x$mhd_cv_host_shtdwn_trgr_select"
644 644
645# SENDMSG. Should we check for SCM_RIGHTS instead? 645# SENDMSG. Should we check for SCM_RIGHTS instead?
646# https://lists.x.org/archives/xorg-devel/2013-November/038687.html 646# https://lists.x.org/archives/xorg-devel/2013-November/038687.html
647AC_MSG_CHECKING([whether sendmsg is available])
647AC_SEARCH_LIBS(sendmsg, socket, AC_DEFINE([HAVE_SENDMSG],1,[Define if your platform supports sendmsg])) 648AC_SEARCH_LIBS(sendmsg, socket, AC_DEFINE([HAVE_SENDMSG],1,[Define if your platform supports sendmsg]))
649AC_MSG_CHECKING([whether writev is available])
648AC_CHECK_FUNCS([writev]) 650AC_CHECK_FUNCS([writev])
649 651
652# check MSG_MORE defined
653AC_MSG_CHECKING([whether MSG_MORE defined])
654AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
655#include <sys/types.h>
656#include <sys/socket.h>
657
658int main(int argc, char **argv)
659{
660 return MSG_MORE;
661}
662 ])],
663 [
664 AC_MSG_RESULT(yes)
665 AC_DEFINE(HAVE_MSG_MORE, [1], [have MSG_MORE])
666 ],
667 [
668 AC_MSG_RESULT(no)
669 ])
670
650# set GCC options 671# set GCC options
651# use '-fno-strict-aliasing', but only if the compiler 672# use '-fno-strict-aliasing', but only if the compiler
652# and linker can take it 673# and linker can take it
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 6637d2d2..8eec8234 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -21,7 +21,7 @@
21/** 21/**
22 * @file microhttpd/mhd_send.c 22 * @file microhttpd/mhd_send.c
23 * @brief Implementation of send() wrappers. 23 * @brief Implementation of send() wrappers.
24 * @author ng0 <ng0@n0.is> 24 * @author ng0 (N. Gillmann)
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 * @author Evgeny Grin 26 * @author Evgeny Grin
27 */ 27 */
@@ -48,7 +48,7 @@ static void
48pre_cork_setsockopt (struct MHD_Connection *connection, 48pre_cork_setsockopt (struct MHD_Connection *connection,
49 bool want_cork) 49 bool want_cork)
50{ 50{
51#if MSG_MORE 51#if HAVE_MSG_MORE
52#else 52#else
53 int ret; 53 int ret;
54 const MHD_SCKT_OPT_BOOL_ off_val = 0; 54 const MHD_SCKT_OPT_BOOL_ off_val = 0;
@@ -101,7 +101,7 @@ static void
101post_cork_setsockopt (struct MHD_Connection *connection, 101post_cork_setsockopt (struct MHD_Connection *connection,
102 bool want_cork) 102 bool want_cork)
103{ 103{
104#if MSG_MORE 104#if HAVE_MSG_MORE
105#else 105#else
106 int ret; 106 int ret;
107 const MHD_SCKT_OPT_BOOL_ off_val = 0; 107 const MHD_SCKT_OPT_BOOL_ off_val = 0;