[Privoxy-devel] max-client-connections

Lee ler762 at gmail.com
Wed Apr 7 12:33:29 UTC 2021


Windows updates seem to take way too long for me, so I had the privoxy
log window open while doing an update and noticed lots of
  Error: Rejecting connection from 127.0.0.1. Maximum number of
connections reached.

I don't know what was going on, and it seems to have stopped before I
changed max-client-connections from 256 to 512, but who is going to
notice that log message as long as it's at the LOG_LEVEL_CONNECT
level?  I almost never have
  debug     2
set.  So I'd like to change the log level to ERROR for everybody
      if ((0 != config->max_client_connections)
         && (active_threads >= config->max_client_connections))
      {
         log_error(LOG_LEVEL_CONNECT,      /* <------------- this to
LOG_LEVEL_ERROR */
            "Rejecting connection from %s. Maximum number of
connections reached.",
            csp->ip_addr_str);


And the documentation for max-client-connections seems wrong:

#  Default value:
#
#      128
#
#  Effect if unset:
#
#      Connections are served until a resource limit is reached.

The default is 128, so there is no possibility of 'unset' - see
loadcfg.c line 654:
   /*
    * 128 client sockets ought to be enough for everybody who can't
    * be bothered to read the documentation to figure out how to
    * increase the limit.
    */
   config->max_client_connections    = 128;

It seems like the

#  Effect if unset:
 line should be deleted and the

#      Connections are served until a resource limit is reached.
 line should be moved under

#  Notes:

or am I missing somthing?  How is it possible for
config->max_client_connections to be zero??   jcc.c line 6099
      if ((0 != config->max_client_connections)
         && (active_threads >= config->max_client_connections))
      {
         log_error(LOG_LEVEL_CONNECT,
            "Rejecting connection from %s. Maximum number of
connections reached.",
            csp->ip_addr_str);
         write_socket_delayed(csp->cfd, TOO_MANY_CONNECTIONS_RESPONSE,
            strlen(TOO_MANY_CONNECTIONS_RESPONSE), get_write_delay(csp));


Thanks,
Lee


More information about the Privoxy-devel mailing list