[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 67/154: remove commented code, replaced by
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 67/154: remove commented code, replaced by functions. |
Date: |
Mon, 19 Aug 2019 10:16:19 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 304002d6b1d88baa747207f0d5d8ae77bda2b118
Author: ng0 <address@hidden>
AuthorDate: Wed Jul 24 11:48:02 2019 +0000
remove commented code, replaced by functions.
---
src/microhttpd/connection.c | 10 ------
src/microhttpd/mhd_send.c | 76 ++++++---------------------------------------
2 files changed, 9 insertions(+), 77 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 6198e1ff..719ba7b6 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -513,16 +513,6 @@ sendfile_adapter (struct MHD_Connection *connection)
if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
{
MHD_send_socket_state_nopush_ (connection, true, false);
- /*
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- TCP_NOPUSH,
- (const void *) &on_val,
- sizeof (on_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- */
}
#endif
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 2b2f9d93..56461942 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -26,6 +26,12 @@
/* TODO: sendfile() wrapper, in connection.c */
+/* Worth considering for future improvements and additions:
+ * NetBSD has no sendfile or sendfile64. The way to work
+ * with this seems to be to mmap the file and write(2) as
+ * large a chunk as possible to the socket. Alternatively,
+ * use madvise(..., MADV_SEQUENTIAL). */
+
/* Functions to be used in: send_param_adapter, MHD_send_
* and every place where sendfile(), sendfile64(), setsockopt()
* are used. */
@@ -201,31 +207,11 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
{
MHD_send_socket_state_nopush_ (connection, true, false);
- /*
- if (0 == setsockopt (s,
- IPPROTO_TCP,
- TCP_NOPUSH,
- (const void *) &on_val,
- sizeof (on_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- */
}
#endif
#if TCP_NODELAY
if ((! using_tls) && (! use_corknopush) && (! have_cork && want_cork))
{
- /*
- if (0 == setsockopt (s,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- */
MHD_send_socket_state_nodelay_ (connection, false);
}
#endif
@@ -332,20 +318,12 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
/* We don't have MSG_MORE. The OS which implement NOPUSH implement
* it in a similar way to TCP_CORK on Linux. This means we can just
* disregard the else branch for TCP_NODELAY which we had to use
- * for the TCP_CORK case here. */
+ * for the TCP_CORK case here.
+ * XXX: Verify this statement and finetune if necessary for
+ * other systems, as only FreeBSD was checked. */
if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
{
MHD_send_socket_state_nopush_ (connection, true, false);
- /*
- if (0 == setsockopt (s,
- IPPROTO_TCP,
- TCP_NOPUSH,
- (const void*) &on_val,
- sizeof (on_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- */
}
#endif
@@ -353,16 +331,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
if ((! using_tls) && (! use_corknopush) && (have_cork && ! want_cork))
{
MHD_send_socket_state_nodelay_ (connection, true);
- /*
- if (0 == setsockopt (s,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) &on_val,
- sizeof (on_val)))
- {
- connection->sk_tcp_nodelay_on = true;
- }
- */
}
#endif
@@ -416,16 +384,6 @@ MHD_send_on_connection2_ (struct MHD_Connection
*connection,
if ((! use_corknopush) && (! have_cork && want_cork))
{
MHD_send_socket_state_nodelay_ (connection, false);
- /*
- if (0 == setsockopt (s,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- */
}
#endif
@@ -475,16 +433,6 @@ MHD_send_on_connection2_ (struct MHD_Connection
*connection,
{
/* Response complete, set NOPUSH to off */
MHD_send_socket_state_nopush_ (connection, false, false);
- /*
- if (0 == setsockopt (s,
- IPPROTO_TCP,
- TCP_NOPUSH,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- */
}
errno = eno;
}
@@ -498,9 +446,3 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
MHD_SSO_HDR_CORK);
#endif
}
-
-/* Worth considering for future improvements and additions:
- * NetBSD has no sendfile or sendfile64. The way to work
- * with this seems to be to mmap the file and write(2) as
- * large a chunk as possible to the socket. Alternatively,
- * use madvise(..., MADV_SEQUENTIAL). */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 41/154: doxygen for send_, (continued)
- [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
- [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 <=
- [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, 2019/08/19
- [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