Remove 7binaryoptions.com from the footer
[privoxy.git] / jbsockets.c
index 765aafb..0f1ba16 100644 (file)
@@ -1,4 +1,3 @@
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.146 2017/06/26 12:11:12 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
@@ -107,8 +106,6 @@ const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.146 2017/06/26 12:11:12 fabia
 #define AI_NUMERICSERV 0
 #endif
 
-const char jbsockets_h_rcs[] = JBSOCKETS_H_VERSION;
-
 /*
  * Maximum number of gethostbyname(_r) retries in case of
  * soft errors (TRY_AGAIN).
@@ -116,8 +113,6 @@ const char jbsockets_h_rcs[] = JBSOCKETS_H_VERSION;
  */
 #define MAX_DNS_RETRIES 10
 
-#define MAX_LISTEN_BACKLOG 128
-
 #ifdef HAVE_RFC2553
 static jb_socket rfc2553_connect_to(const char *host, int portnum, struct client_state *csp);
 #else
@@ -128,7 +123,8 @@ static jb_socket no_rfc2553_connect_to(const char *host, int portnum, struct cli
  *
  * Function    :  set_no_delay_flag
  *
- * Description :  Disables TCP coalescence for the given socket.
+ * Description :  Disables the Nagle algorithm (TCP send coalescence)
+ *                for the given socket.
  *
  * Parameters  :
  *          1  :  fd = The file descriptor to operate on
@@ -890,14 +886,15 @@ void drain_and_close_socket(jb_socket fd)
  * Parameters  :
  *          1  :  hostnam = TCP/IP address to bind/listen to
  *          2  :  portnum = port to listen on
- *          3  :  pfd = pointer used to return file descriptor.
+ *          3  :  backlog = Listen backlog
+ *          4  :  pfd = pointer used to return file descriptor.
  *
  * Returns     :  if success, returns 0 and sets *pfd.
  *                if failure, returns -3 if address is in use,
  *                                    -2 if address unresolvable,
  *                                    -1 otherwise
  *********************************************************************/
-int bind_port(const char *hostnam, int portnum, jb_socket *pfd)
+int bind_port(const char *hostnam, int portnum, int backlog, jb_socket *pfd)
 {
 #ifdef HAVE_RFC2553
    struct addrinfo hints;
@@ -1072,7 +1069,7 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd)
    }
 #endif /* ndef HAVE_RFC2553 */
 
-   while (listen(fd, MAX_LISTEN_BACKLOG) == -1)
+   while (listen(fd, backlog) == -1)
    {
       if (errno != EINTR)
       {