gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 01/04: mhd_sockets: removed dead code


From: gnunet
Subject: [libmicrohttpd] 01/04: mhd_sockets: removed dead code
Date: Sun, 18 Apr 2021 19:49:52 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

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

    mhd_sockets: removed dead code
---
 src/microhttpd/mhd_sockets.c | 78 --------------------------------------------
 src/microhttpd/mhd_sockets.h | 34 -------------------
 2 files changed, 112 deletions(-)

diff --git a/src/microhttpd/mhd_sockets.c b/src/microhttpd/mhd_sockets.c
index fef7085c..aae8a496 100644
--- a/src/microhttpd/mhd_sockets.c
+++ b/src/microhttpd/mhd_sockets.c
@@ -489,84 +489,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.
  *
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
index b16a8b1a..5e82faa6 100644
--- 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;
 /**

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]