libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 61858b1e1af6a9c73e778c3f5765d5819ad6c924
parent 2a0c96ff5bba1bf153e067e5021f974dbca71525
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sun, 18 Apr 2021 13:47:37 +0300

mhd_sockets: removed dead code

Diffstat:
Msrc/microhttpd/mhd_sockets.c | 78------------------------------------------------------------------------------
Msrc/microhttpd/mhd_sockets.h | 34----------------------------------
2 files changed, 0 insertions(+), 112 deletions(-)

diff --git a/src/microhttpd/mhd_sockets.c b/src/microhttpd/mhd_sockets.c @@ -490,84 +490,6 @@ MHD_socket_set_nodelay_ (MHD_socket sock, /** - * Enable/disable the cork option. - * - * @param sock socket to manipulate - * @param on set to true to enable CORK, false to disable - * @return non-zero if succeeded, zero otherwise - */ -int -MHD_socket_cork_ (MHD_socket sock, - bool on) -{ -#if defined(MHD_TCP_CORK_NOPUSH) - const MHD_SCKT_OPT_BOOL_ off_val = 0; - const MHD_SCKT_OPT_BOOL_ on_val = 1; - - /* Disable extra buffering */ - if (MHD_INVALID_SOCKET == sock) - { - errno = EBADF; - return 0; /* failed */ - } - if (0 != setsockopt (sock, - IPPROTO_TCP, - MHD_TCP_CORK_NOPUSH, - (const void *) (on ? &on_val : &off_val), - sizeof (off_val))) - return 0; /* failed */ -#if defined(_MHD_CORK_RESET_PUSH_DATA) - return 1; -#else /* ! _MHD_CORK_RESET_PUSH_DATA */ - if (! on) - { - const int dummy = 0; - /* Force flush data with zero send otherwise Darwin and some BSD systems - will add 5 seconds delay. Not required with TCP_CORK as switching off - TCP_CORK always flushes socket buffer. */ - if (0 > send (sock, - &dummy, - 0, - 0)) - return 0; /* even force flush failed!? */ - return 1; /* success */ - } - return 1; -#endif /* ! _MHD_CORK_RESET_PUSH_DATA */ -#else /* ! MHD_TCP_CORK_NOPUSH */ - /* do not have MHD_TCP_CORK_NOPUSH at all */ - (void) sock; (void) on; /* Mute compiler warnings */ - return 0; -#endif /* ! MHD_TCP_CORK_NOPUSH */ -} - - -/** - * Change socket buffering mode to default. - * - * @param sock socket to manipulate - * @return non-zero if succeeded, zero otherwise - */ -int -MHD_socket_buffering_reset_ (MHD_socket sock) -{ -#if defined(MHD_TCP_CORK_NOPUSH) - int res = ! MHD_socket_set_nodelay_ (sock, - true); - /* Disable extra buffering */ - return MHD_socket_cork_ (sock, - false) && res; -#elif defined(HAVE_MSG_MORE) - return ! MHD_socket_set_nodelay_ (sock, - true); -#else - return ! MHD_socket_set_nodelay_ (sock, - false); -#endif /* MHD_TCP_CORK_NOPUSH */ -} - - -/** * Create a listen socket, with noninheritable flag if possible. * * @param pf protocol family to use diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h @@ -892,40 +892,6 @@ int MHD_socket_noninheritable_ (MHD_socket sock); -/** - * Enable/disable the cork option. - * - * TCP_NOPUSH has the same logic as MSG_MSG_MORE. - * The two are more or less equivalent by a source - * transformation (ie - * send(MSG_MORE) => "set TCP_NOPUSH + send() + clear TCP_NOPUSH". - * Both of them are really fairly "local", but TCP_NOPUSH has a - * _notion_ of persistency that is entirely lacking in MSG_MORE. - * ... with TCP_NOPUSH you basically have to know what your last - * write is, and clear the bit _before_ that write if you want - * to avoid bad latencies. - * - * See also: https://yarchive.net/comp/linux/sendfile.html - * - * @param sock socket to manipulate - * @param on set to true to enable CORK, false to disable - * @return non-zero if succeeded, zero otherwise - */ -int -MHD_socket_cork_ (MHD_socket sock, - bool on); - - -/** - * Change socket buffering mode to default. - * - * @param sock socket to manipulate - * @return non-zero if succeeded, zero otherwise - */ -int -MHD_socket_buffering_reset_ (MHD_socket sock); - - #if defined(SOL_SOCKET) && defined(SO_NOSIGPIPE) static const int _MHD_socket_int_one = 1; /**