On 01/05/2006 05:24 PM, Joe Orton wrote: > On Thu, Jan 05, 2006 at 08:14:58AM -0800, Justin Erenkrantz wrote: > >>I do note that the 2.0 code says: >> >> /* The client has aborted, but the request was successful. We >> * will report success, and leave it to the access and error >> * logs to note that the connection was aborted. >> */ >> return APR_SUCCESS;
This comment is also in 2.2.x. I thought that it was there for good reason, so I implemented this behaviour again in the patch. >> >>I'm just not sure I agree with that. -- justin > > > Yes, that little "feature" is a great source of module bugs so it would > be great to remove it. > > The problem it works around is really the fact that the default_handler > does the bogus trick of returning: > > return ap_pass_brigade(r->output_filters, bb); So I understand that we have two problems here: 1. A non working setting of c->aborted, which should be fixed by the new version of the patch, which leaves the return codes as they are. I will commit it soon. 2. The behaviour of at least the default_handler to possibly return an APR error code if a filter returns non-APR_SUCCESS. Regards Rüdiger
Index: server/core_filters.c =================================================================== --- server/core_filters.c (Revision 366181) +++ server/core_filters.c (Arbeitskopie) @@ -416,6 +416,10 @@ if (APR_STATUS_IS_EAGAIN(rv)) { rv = APR_SUCCESS; } + else if (rv != APR_SUCCESS) { + /* The client has aborted the connection */ + c->aborted = 1; + } setaside_remaining_output(f, ctx, bb, 0, c); return rv; } @@ -430,6 +434,8 @@ apr_status_t rv = send_brigade_blocking(net->client_socket, bb, &(ctx->bytes_written), c); if (rv != APR_SUCCESS) { + /* The client has aborted the connection */ + c->aborted = 1; return rv; } bb = remainder; @@ -464,6 +470,8 @@ apr_status_t rv = send_brigade_blocking(net->client_socket, bb, &(ctx->bytes_written), c); if (rv != APR_SUCCESS) { + /* The client has aborted the connection */ + c->aborted = 1; return rv; } } @@ -471,6 +479,8 @@ apr_status_t rv = send_brigade_nonblocking(net->client_socket, bb, &(ctx->bytes_written), c); if ((rv != APR_SUCCESS) && (!APR_STATUS_IS_EAGAIN(rv))) { + /* The client has aborted the connection */ + c->aborted = 1; return rv; } }