httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: I/O timeouts in A2 (was Re: Pools and Threads and Errors)
Date Fri, 15 Jan 1999 01:06:13 GMT


On Thu, 14 Jan 1999, Ben Hyde wrote:

> Dean Gaudet writes:
> >It calls the previously unused error handler for the BUFF, which gives the
> >user a chance to do something special.  I forget exactly what I did. 
> 
> Unused in the core code possibly.

Yeah it doesn't really affect others I don't think.  I think I just
cleared up the semantics.  Maybe.

> Could not timing out the I/O be handled much as losing the connection,
> except for possibly the log message?

/* XXX: this should really take a request_rec as the data, so that info
 * about the pathname causing the error can be displayed.  But to do that
 * the child_main loop needs to be careful about calling ap_bonerror()
 * after it destroys the request.  Deal with that later.
 */
static void client_bonerror_handler(BUFF *fb, int direction, void *vb)
{
    conn_rec *conn;
    const char *errstr;

    switch (PR_GetError()) {
    case PR_IO_TIMEOUT_ERROR:
        errstr = "client %s timed out during %s (%s)";
        break;

    case PR_CONNECT_RESET_ERROR:
        errstr = "client %s stopped connection before %s (%s) completed";
        break;

    default:
        errstr = "client %s had an i/o error during %s (%s)";
        break;
    }
    conn = vb;
    ap_log_error(APLOG_MARK, APLOG_INFO, conn->server, errstr,
                conn->remote_ip,
                conn->timeout_name ? conn->timeout_name : "request",
                (direction == B_RD) ? "read" : "write");
}

... and in ap_read_request we have:

    ap_bonerror(conn->client, client_bonerror_handler, conn);
    conn->timeout_name = "read request line";
    ap_bsetopt(conn->client, BO_TIMEOUT,
        conn->keptalive
            ? &r->server->keep_alive_timeout_interval
            : &r->server->timeout_interval);

folks can play with conn->timeout_name to change what's logged.

Dean


Mime
View raw message