[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 137/154: remove obsolete OLD_SOCK if'd bloc
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 137/154: remove obsolete OLD_SOCK if'd blocks. |
Date: |
Mon, 19 Aug 2019 10:17:29 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 682955506e4b564cd58fcf7af733407903fb05ec
Author: ng0 <address@hidden>
AuthorDate: Fri Aug 2 08:43:25 2019 +0000
remove obsolete OLD_SOCK if'd blocks.
---
src/microhttpd/connection.c | 127 --------------------------------------------
1 file changed, 127 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index c2add01a..cee38b8d 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -320,51 +320,6 @@ _MHD_static_inline bool
socket_start_extra_buffering (struct MHD_Connection *connection)
{
mhd_assert(NULL != connection);
-#if OLD_SOCKOPT
-#if defined(TCP_NODELAY)
- if (connection->sk_tcp_nodelay_on)
- {
- const MHD_SCKT_OPT_BOOL_ off_val = 0;
- /* Enable Nagle's algorithm */
- /* TCP_NODELAY may interfere with TCP_NOPUSH */
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- }
-#endif /* TCP_NODELAY */
-#endif /* OLD_SOCKOPT */
-
-#if OLD_SOCKOPT
-#if defined(MHD_TCP_CORK_NOPUSH)
- if (!connection->sk_tcp_cork_nopush_on)
- {
- const MHD_SCKT_OPT_BOOL_ on_val = 1;
- /* Buffer data before sending (TCP_CORK) or
- * Send only full frames (TCP_NOPUSH) */
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- MHD_TCP_CORK_NOPUSH,
- (const void *) &on_val,
- sizeof (on_val)))
- {
- connection->sk_tcp_cork_nopush_on = true;
- }
- }
-#endif /* MHD_TCP_CORK_NOPUSH */
-#endif /* OLD_SOCKOPT */
-
-#if OLD_SOCKOPT
-#if defined(TCP_NODELAY)
- return connection->sk_tcp_cork_nopush_on && !connection->sk_tcp_nodelay_on;
-#else /* ! TCP_NODELAY */
- return connection->sk_tcp_cork_nopush_on;
-#endif /* ! TCP_NODELAY */
-#endif /* OLD_SOCKOPT */
}
@@ -377,40 +332,7 @@ socket_start_extra_buffering (struct MHD_Connection
*connection)
_MHD_static_inline bool
socket_start_no_buffering (struct MHD_Connection *connection)
{
-#if OLD_SOCKOPT
-#if defined(MHD_TCP_CORK_NOPUSH)
- if (connection->sk_tcp_cork_nopush_on)
- {
- const MHD_SCKT_OPT_BOOL_ off_val = 0;
- /* Disable extra buffering */
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- MHD_TCP_CORK_NOPUSH,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_cork_nopush_on = false;
- }
- }
-#endif /* MHD_TCP_CORK_NOPUSH */
-#if defined(TCP_NODELAY)
- if (!connection->sk_tcp_nodelay_on)
- {
- const MHD_SCKT_OPT_BOOL_ on_val = 1;
- /* Enable sending without delay */
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) &on_val,
- sizeof (on_val)))
- {
- connection->sk_tcp_nodelay_on = true;
- }
- }
-#endif /* TCP_NODELAY */
- return connection->sk_tcp_nodelay_on && !connection->sk_tcp_cork_nopush_on;
-#endif /* OLD_SOCKOPT */
}
@@ -428,21 +350,6 @@ socket_start_no_buffering_flush (struct MHD_Connection
*connection)
#if defined(TCP_NOPUSH) && !defined(TCP_CORK)
const int dummy = 0;
#endif /* !TCP_CORK */
-#if OLD_SOCKOPT
-#if defined(TCP_CORK) || (defined(__FreeBSD__) && __FreeBSD__+0 >= 9)
- const MHD_SCKT_OPT_BOOL_ off_val = 0;
- /* Switching off TCP_CORK flush buffer even
- * if TCP_CORK was not enabled */
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- MHD_TCP_CORK_NOPUSH,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_cork_nopush_on = false;
- }
-#endif /* MHD_TCP_CORK_NOPUSH */
-#endif /* OLD_SOCKOPT */
res = socket_start_no_buffering (connection);
#if defined(__FreeBSD__) && __FreeBSD__+0 >= 9
/* FreeBSD do not need zero-send for flushing starting from version 9 */
@@ -468,40 +375,6 @@ _MHD_static_inline bool
socket_start_normal_buffering (struct MHD_Connection *connection)
{
mhd_assert(NULL != connection);
-#if OLD_SOCKOPT
-#if defined(MHD_TCP_CORK_NOPUSH)
- if (connection->sk_tcp_cork_nopush_on)
- {
- const MHD_SCKT_OPT_BOOL_ off_val = 0;
- /* Disable extra buffering */
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- MHD_TCP_CORK_NOPUSH,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_cork_nopush_on = false;
- }
- }
-#endif /* MHD_TCP_CORK_NOPUSH */
-
-#if defined(TCP_NODELAY)
- if (connection->sk_tcp_nodelay_on)
- {
- const MHD_SCKT_OPT_BOOL_ off_val = 0;
- /* Enable Nagle's algorithm */
- if (0 == setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) &off_val,
- sizeof (off_val)))
- {
- connection->sk_tcp_nodelay_on = false;
- }
- }
-#endif /* TCP_NODELAY */
- return !connection->sk_tcp_nodelay_on && !connection->sk_tcp_cork_nopush_on;
-#endif
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 96/154: simplify, (continued)
- [GNUnet-SVN] [libmicrohttpd] 96/154: simplify, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 113/154: _len -> _size, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 147/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 149/154: connection.c: remove 2 more calls of dead code., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 122/154: partial fix to sendmsg code, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 134/154: handle TLS case in send_on_connectin2, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 128/154: TCP_NOPUSH, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 141/154: Document MHD_UPGRADE_ACTION_CORK_ON and HD_UPGRADE_ACTION_CORK_OFF., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 145/154: remove more code., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 143/154: fix a couple of fixmes: add log messages., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 137/154: remove obsolete OLD_SOCK if'd blocks.,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 142/154: Add draft of Changelog., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 150/154: mhd_send.c: log EINVAL, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 148/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 88/154: attempt fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 71/154: lisp sneeks in., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 75/154: switch functions., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 95/154: simplify, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 68/154: Add MHD_send_socket_state_cork_nodelay_ and use it., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 65/154: remove old function name., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 94/154: simplify, gnunet, 2019/08/19