summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-08-02 08:43:25 +0000
committerng0 <ng0@n0.is>2019-08-02 08:43:25 +0000
commit682955506e4b564cd58fcf7af733407903fb05ec (patch)
tree5ce87952a9aa26f8eb11249855be52907baa433b
parent2754ba51f406c2d8a14f689c397c6982568bc06b (diff)
remove obsolete OLD_SOCK if'd blocks.
-rw-r--r--src/microhttpd/connection.c127
1 files changed, 0 insertions, 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
}