You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2004/11/01 14:06:52 UTC

cvs commit: httpd-2.0/server core.c

trawick     2004/11/01 05:06:52

  Modified:    .        CHANGES
               server   core.c
  Log:
  Change core connection handling so that a connection-oriented
  error disabling nagle* is logged with the client IP address and
  a debug log level.  We filter out not-implemented errors from
  platforms which don't support TCP_NODELAY.
  
  *This is typically EINVAL, which means that the client already
  dropped the connection.
  
  Also, mention an earlier change to include the client IP address
  when logging connection-oriented errors.
  
  Revision  Changes    Path
  1.1622    +6 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1621
  retrieving revision 1.1622
  diff -u -r1.1621 -r1.1622
  --- CHANGES	29 Oct 2004 14:45:21 -0000	1.1621
  +++ CHANGES	1 Nov 2004 13:06:51 -0000	1.1622
  @@ -2,6 +2,12 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Log the client IP address when an error occurs disabling nagle on a
  +     connection, but log at a severity of debug since this error 
  +     generally means that the connection was dropped before data was
  +     sent.  Log the client IP address when reporting errors in the core
  +     output filter.  [Jeff Trawick]
  +
     *) Add ap_log_cerror() for logging messages associated with particular
        client connections.  [Jeff Trawick]
   
  
  
  
  1.291     +16 -1     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.290
  retrieving revision 1.291
  diff -u -r1.290 -r1.291
  --- core.c	29 Oct 2004 14:45:24 -0000	1.290
  +++ core.c	1 Nov 2004 13:06:51 -0000	1.291
  @@ -4544,6 +4544,7 @@
   static int core_pre_connection(conn_rec *c, void *csd)
   {
       core_net_rec *net = apr_palloc(c->pool, sizeof(*net));
  +    apr_status_t rv;
   
   #ifdef AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
       /* BillS says perhaps this should be moved to the MPMs. Some OSes
  @@ -4551,7 +4552,21 @@
        * accept sockets which means this call only needs to be made
        * once on the listener
        */
  -    ap_sock_disable_nagle(csd);
  +    /* The Nagle algorithm says that we should delay sending partial
  +     * packets in hopes of getting more data.  We don't want to do
  +     * this; we are not telnet.  There are bad interactions between
  +     * persistent connections and Nagle's algorithm that have very severe
  +     * performance penalties.  (Failing to disable Nagle is not much of a
  +     * problem with simple HTTP.)
  +     */
  +    rv = apr_socket_opt_set(csd, APR_TCP_NODELAY, 1);
  +    if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
  +        /* expected cause is that the client disconnected already,
  +         * hence the debug level
  +         */
  +        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, c,
  +                      "apr_socket_opt_set(APR_TCP_NODELAY)");
  +    }
   #endif
       net->c = c;
       net->in_ctx = NULL;