[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 58/154: start SENDMSG/WRITEV.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 58/154: start SENDMSG/WRITEV. |
Date: |
Mon, 19 Aug 2019 10:16:10 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 42e98f38c6fa85d953f275c8d9a693bc77fee7cf
Author: ng0 <address@hidden>
AuthorDate: Tue Jul 23 10:26:55 2019 +0000
start SENDMSG/WRITEV.
---
src/microhttpd/mhd_send.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 210ad658..0de40a42 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -327,7 +327,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
const char *buffer,
size_t buffer_size)
{
-#if HAVE_WRITEV
+#if defined(HAVE_SENDMSG) || defined(HAVE_WRITEV)
MHD_socket s = connection->socket_fd;
bool have_cork;
bool have_more;
@@ -363,9 +363,16 @@ MHD_send_on_connection2_ (struct MHD_Connection
*connection,
vector[0].iov_len = strlen (header);
vector[1].iov_base = buffer;
vector[1].iov_len = strlen (buffer);
+
+#if HAVE_SENDMSG
+ struct msghdr msg;
+ msg.msg_iov = vector;
+ memset(&msg, 0, sizeof(buffer + header));
+ ret = sendmsg (s, vector, MAYBE_MSG_NOSIGNAL);
+#elif HAVE_WRITEV
iovcnt = sizeof (vector) / sizeof (struct iovec);
- // FIXME: maybe use sendmsg() if available instead!
- ret = writev (connection->socket_fd, vector, iovcnt);
+ ret = writev (s, vector, iovcnt);
+#endif
#if TCP_CORK
if (use_corknopush)
@@ -418,3 +425,12 @@ MHD_send_on_connection2_ (struct MHD_Connection
*connection,
MHD_SSO_HDR_CORK);
#endif
}
+
+ssize_t
+MHD_sendfile_on_connection_ (struct MHD_Connection *connection,
+ const char *buffer,
+ size_t buffer_size,
+ enum MHD_SendSocketOptions options)
+{
+ // TODO
+}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 30/154: comments, (continued)
- [GNUnet-SVN] [libmicrohttpd] 30/154: comments, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 49/154: more OLDSOCK., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 59/154: sendfile and netbsd, comment., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 31/154: combine ifs, fix uninitialized var error, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 62/154: fix errors., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 35/154: use using_tls, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 36/154: implement TCP_NOPUSH branch content, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 34/154: Use s in setsockopt(), gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 38/154: check getsockopt's., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 64/154: move sendfile function work to connection.c, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 58/154: start SENDMSG/WRITEV.,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 60/154: doxygen fix., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 57/154: cover the case of TCP_NOPUSH and TCP_CORK coexisting on the same OS., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 56/154: doxygen, links, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 52/154: doxygen, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 40/154: doxygen for _send2, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 48/154: connection.c: preprocessor ifdef some setsockopts., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 46/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 53/154: reminder, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 41/154: doxygen for send_, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 50/154: do use MSG_NOSIGNAL in send() if available, gnunet, 2019/08/19