[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 06/154: mhd_send: Move return_bytes related
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 06/154: mhd_send: Move return_bytes related code into the right place. |
Date: |
Mon, 19 Aug 2019 10:15:18 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 883c72f9a69ac3ccf591742327c3e425e47a8ea0
Author: ng0 <address@hidden>
AuthorDate: Mon Jun 17 17:20:21 2019 +0000
mhd_send: Move return_bytes related code into the right place.
---
src/microhttpd/mhd_send.c | 53 +++++++++++++++++++++++------------------------
1 file changed, 26 insertions(+), 27 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 1394aa70..4af5680c 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -260,7 +260,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
size_t buffer_size,
enum MHD_SendSocketOptions)
{
- int errno = 0;
+ int errno = 0;
MHD_socket s = connection->socket_fd;
// -- <pseudo>
// set socket := connect->MHD_socket
@@ -286,40 +286,39 @@ MHD_send_on_connection2_ (struct MHD_Connection
*connection,
// return -1
// return numBytes
// -- </pseudo>
-#ifdef WRITEV
- int iovcnt;
- struct iovec vector[2];
- vector[0].iov_base = header;
- vector[0].iov_len = strlen (header);
- vector[1].iov_base = buffer;
- vector[1].iov_len = strlen (buffer);
- iovcnt = sizeof (vector) / sizeof (struct iovec);
- int i = writev (s, vector, iovcnt);
- fprintf (stdout, "i=%d, errno=%d\n", i, errno);
-#else
- // not available, send a combination of header + buffer.
- size_t concatsize = header_size + buffer_size;
- const char *concatbuffer;
- concatbuffer = header + buffer;
-#ifdef MSG_MORE
- num_bytes = send (s, concatbuffer, concatsize, MSG_MORE);
-#else
- num_bytes = send (s, concatbuffer, concatsize);
-#endif
-#endif
struct tcp_info *tcp_;
size_t opt1, opt2, length;
switch (MHD_SendSocketOptions)
{
case MHD_SSO_NO_CORK:
- /* No corking */
+ /* No corking */
case MHD_SSO_MAY_CORK:
case MHD_SSO_HDR_CORK:
}
-if (MHD_SendSocketOptions == 1)
-{
- // bla
-}
+ if (MHD_SendSocketOptions == 1)
+ {
+#ifdef WRITEV
+ int iovcnt;
+ struct iovec vector[2];
+ vector[0].iov_base = header;
+ vector[0].iov_len = strlen (header);
+ vector[1].iov_base = buffer;
+ vector[1].iov_len = strlen (buffer);
+ iovcnt = sizeof (vector) / sizeof (struct iovec);
+ int i = writev (s, vector, iovcnt);
+ fprintf (stdout, "i=%d, errno=%d\n", i, errno);
+#else
+ // not available, send a combination of header + buffer.
+ //size_t concatsize = header_size + buffer_size;
+ //const char *concatbuffer;
+ //concatbuffer = header + buffer;
+#ifdef MSG_MORE
+ num_bytes = send (s, header, header_size, MSG_MORE);
+#else
+ num_bytes = send (s, header, header_size);
+#endif
+#endif
+ }
if (0 != errno)
return -1;
if (0 == errno)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] branch master updated (316f6ab3 -> e82de750), gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 01/154: mhd_send: Add initial version., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 04/154: mhd_send: minor typo, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 02/154: mhd_send, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 03/154: mhd_send: fix switch., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 05/154: mhd_send: remove unnecessary comments., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 08/154: fix syntax, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 06/154: mhd_send: Move return_bytes related code into the right place.,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 07/154: provide example for use of getsockopt to get MSS, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 09/154: startingpoint, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 14/154: mhd_send.c: Try to guess the right branch to close., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 17/154: mhd_send: start adding logic from send_param_adapter., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 12/154: Add mhd_send to Makefile, more fixes in mhd_send., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 20/154: mhd_send.c: variable declarations (style)., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 19/154: adjust, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 11/154: restructure a bit to reuse existing send function, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 23/154: mhd_send: change send_tls_adapter() to non-static and export its prototype, use it in mhd_send.c, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 22/154: mhd_send.c: call send_tls_adapter() when TLS is used., gnunet, 2019/08/19