diff options
author | ng0 <ng0@n0.is> | 2019-07-22 15:29:56 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-07-22 15:29:56 +0000 |
commit | 6d1993c5c1f52e259d5f5dacde5e321a3b1a19f2 (patch) | |
tree | 17b73a0c65459eb2b1bbcb437b83ef2006b22762 /src/microhttpd/connection.c | |
parent | e33528862ac09ae22d06baaf1d3b92d973dd2b22 (diff) | |
download | libmicrohttpd-6d1993c5c1f52e259d5f5dacde5e321a3b1a19f2.tar.gz libmicrohttpd-6d1993c5c1f52e259d5f5dacde5e321a3b1a19f2.zip |
connection.c: preprocessor ifdef some setsockopts.
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 4d93acee..887ad391 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -501,6 +501,7 @@ _MHD_static_inline bool | |||
501 | socket_start_extra_buffering (struct MHD_Connection *connection) | 501 | socket_start_extra_buffering (struct MHD_Connection *connection) |
502 | { | 502 | { |
503 | mhd_assert(NULL != connection); | 503 | mhd_assert(NULL != connection); |
504 | #if OLD_SOCKOPT | ||
504 | #if defined(TCP_NODELAY) | 505 | #if defined(TCP_NODELAY) |
505 | if (connection->sk_tcp_nodelay_on) | 506 | if (connection->sk_tcp_nodelay_on) |
506 | { | 507 | { |
@@ -517,7 +518,9 @@ socket_start_extra_buffering (struct MHD_Connection *connection) | |||
517 | } | 518 | } |
518 | } | 519 | } |
519 | #endif /* TCP_NODELAY */ | 520 | #endif /* TCP_NODELAY */ |
521 | #endif /* OLD_SOCKOPT */ | ||
520 | 522 | ||
523 | #if OLD_SOCKOPT | ||
521 | #if defined(MHD_TCP_CORK_NOPUSH) | 524 | #if defined(MHD_TCP_CORK_NOPUSH) |
522 | if (!connection->sk_tcp_cork_nopush_on) | 525 | if (!connection->sk_tcp_cork_nopush_on) |
523 | { | 526 | { |
@@ -534,12 +537,15 @@ socket_start_extra_buffering (struct MHD_Connection *connection) | |||
534 | } | 537 | } |
535 | } | 538 | } |
536 | #endif /* MHD_TCP_CORK_NOPUSH */ | 539 | #endif /* MHD_TCP_CORK_NOPUSH */ |
540 | #endif /* OLD_SOCKOPT */ | ||
537 | 541 | ||
542 | #if OLD_SOCKOPT | ||
538 | #if defined(TCP_NODELAY) | 543 | #if defined(TCP_NODELAY) |
539 | return connection->sk_tcp_cork_nopush_on && !connection->sk_tcp_nodelay_on; | 544 | return connection->sk_tcp_cork_nopush_on && !connection->sk_tcp_nodelay_on; |
540 | #else /* ! TCP_NODELAY */ | 545 | #else /* ! TCP_NODELAY */ |
541 | return connection->sk_tcp_cork_nopush_on; | 546 | return connection->sk_tcp_cork_nopush_on; |
542 | #endif /* ! TCP_NODELAY */ | 547 | #endif /* ! TCP_NODELAY */ |
548 | #endif /* OLD_SOCKOPT */ | ||
543 | } | 549 | } |
544 | 550 | ||
545 | 551 | ||