httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <stodd...@raleigh.ibm.com>
Subject Re: ap_send_fb_length() oddness
Date Thu, 13 Apr 2000 21:49:05 GMT
In fact, both of the places where we set the connection aborted look wrong to me. In both
places, we are 'declaring' the network connection aborted because of return status from a
read from a pipe.

Bill

  while (!ap_is_aborted(r->connection)) {
        rv = ap_bread(fb, buf, sizeof(buf), &n);
        if (n == 0) {
            if (rv == APR_SUCCESS) {    /* eof */
                (void) ap_rflush(r);
                break;
            }
            if (rv != APR_EAGAIN) {
                r->connection->aborted = 1;   /* HERE */
                break;
            }
            /* next read will block, so flush the client now */
            if (ap_rflush(r) == EOF) {
                break;
            }

            ap_bsetopt(fb, BO_TIMEOUT, &r->server->timeout);
            rv = ap_bread(fb, buf, sizeof(buf), &n);
            if (n == 0) {
                if (rv == APR_SUCCESS) {        /* eof */
                    (void) ap_rflush(r);
                }
                r->connection->aborted = 1;  /* AND HERE */
                break;
            }
            ap_bsetopt(fb, BO_TIMEOUT, &zero_timeout);
        }


>
>
> > Here is a piece of code from ap_send_fb_length().  The section of code handles the
> > blocking read on a CGI pipe.
> >
> > Should we be seting connection aborted (r->connection->aborted = 1) when the
other
side
> of
> > the pipe is closed signaling EOF?  This is totally non-intuitive to me. Why mark
the
> > network connection as aborted just because the pipe closed down?
> >
> >
> >
> >             ap_bsetopt(fb, BO_TIMEOUT, &r->server->timeout);
> >             rv = ap_bread(fb, buf, sizeof(buf), &n);
> >             if (n == 0) {
> >                 if (rv == APR_SUCCESS) {        /* eof */
> >                     (void) ap_rflush(r);
> >                 }
> >                 r->connection->aborted = 1;  /* LOOK HERE... Should we be
doing this
> here?
> > */
> >                 break;
> >             }
> >             ap_bsetopt(fb, BO_TIMEOUT, &zero_timeout);
> >
> >
> >
>


Mime
View raw message