[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 72/154: first attempt to add MHD_send_on_co
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 72/154: first attempt to add MHD_send_on_connection2_ |
Date: |
Mon, 19 Aug 2019 10:16:24 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 51cfb23f17b55708fb569b46df90914e70b5a077
Author: ng0 <address@hidden>
AuthorDate: Wed Jul 24 15:05:51 2019 +0000
first attempt to add MHD_send_on_connection2_
---
src/microhttpd/connection.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 3275a3d5..b09425b4 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3408,20 +3408,26 @@ MHD_connection_handle_write (struct MHD_Connection
*connection)
mhd_assert (0);
return;
case MHD_CONNECTION_HEADERS_SENDING:
- /* TODO: Maybe use MHD_send_on_connection2_()? */
- /*
- ret = MHD_send_on_connection2_ (struct MHD_Connection *connection,
- const char *header,
- size_t header_size,
- const char *buffer,
- size_t buffer_size);
- */
- ret = MHD_send_on_connection_ (connection,
- &connection->write_buffer
- [connection->write_buffer_send_offset],
- connection->write_buffer_append_offset -
- connection->write_buffer_send_offset,
- MHD_SSO_MAY_CORK);
+ /* if the response body is not available, we use
MHD_send_on_connection_() */
+ if (sizeof(connection->response->data) <= 1024) /* bad magic number */
+ {
+ ret = MHD_send_on_connection_ (connection,
+ &connection->write_buffer
+
[connection->write_buffer_send_offset],
+
connection->write_buffer_append_offset -
+ connection->write_buffer_send_offset,
+ MHD_SSO_MAY_CORK);
+ }
+ else
+ {
+ ret = MHD_send_on_connection2_ (connection,
+ &connection->write_buffer
+
[connection->write_buffer_send_offset],
+
connection->write_buffer_append_offset -
+
connection->write_buffer_send_offset,
+ response_body,
+ response_size);
+ }
if (ret < 0)
{
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 47/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, (continued)
- [GNUnet-SVN] [libmicrohttpd] 47/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 42/154: indent, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 54/154: Merge branch 'dev/ng0/gsoc2019' of git+ssh://gnunet.org/libmicrohttpd into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 51/154: gnutls cork integration, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 61/154: incomplete commit, adding 2 new helper functions and more., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 69/154: function replace., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 79/154: fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 82/154: revert last patch, should be only on master for now, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 67/154: remove commented code, replaced by functions., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 85/154: pre_cork socket.., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 72/154: first attempt to add MHD_send_on_connection2_,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 66/154: doxygen., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 70/154: conditionally return and setsockopt., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 74/154: fix failure to build., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 73/154: Start reworking into generic setsockopt wrapper., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 84/154: Merge branch 'dev/ng0/gsoc2019' of gnunet.org:libmicrohttpd into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 77/154: fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 78/154: buffersize, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 90/154: show not tell, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 81/154: Merge branch 'dev/ng0/gsoc2019' of git+ssh://gnunet.org/libmicrohttpd into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 83/154: post_cork function first draft, gnunet, 2019/08/19