On 01/02/2006 04:14 PM, Ruediger Pluem wrote:
> I just noticed that c->aborted does not get set on trunk when you abort a
> connection in the browser (with worker mpm,
> but I guess with prefork is the same).
> This works in 2.2.x. I guess this has something to do with the async write
> refactoring in the trunk compared
> to 2.2.x. In 2.2.x c->aborted gets set in the core output filter whereas in
> the trunk this has vanished.
I had a look into this and created a patch that solved my test case. But as the
core output filter is a fundamental
part of the code I would like to have some remote eyes on it. My approach was
to simulate the 'old behaviour'
in 2.2.x:
Index: server/core_filters.c
===================================================================
--- server/core_filters.c»······(Revision 366181)
+++ server/core_filters.c»······(Arbeitskopie)
@@ -413,11 +413,12 @@
if (new_bb == NULL) {
apr_status_t rv = send_brigade_nonblocking(net->client_socket, bb,
&(ctx->bytes_written), c);
- if (APR_STATUS_IS_EAGAIN(rv)) {
- rv = APR_SUCCESS;
+ if ((rv != APR_SUCCESS) && !APR_STATUS_IS_EAGAIN(rv)) {
+ /* The client aborted the connection */
+ c->aborted = 1;
}
setaside_remaining_output(f, ctx, bb, 0, c);
- return rv;
+ return APR_SUCCESS;
}
·
bytes_in_brigade = 0;
@@ -430,7 +431,9 @@
apr_status_t rv = send_brigade_blocking(net->client_socket, bb,
&(ctx->bytes_written), c);
if (rv != APR_SUCCESS) {
- return rv;
+ /* The client aborted the connection */
+ c->aborted = 1;
+ return APR_SUCCESS;
}
bb = remainder;
next = APR_BRIGADE_FIRST(bb);
@@ -464,14 +467,18 @@
apr_status_t rv = send_brigade_blocking(net->client_socket, bb,
&(ctx->bytes_written), c);
if (rv != APR_SUCCESS) {
- return rv;
+ /* The client aborted the connection */
+ c->aborted = 1;
+ return APR_SUCCESS;
}
}
else if (bytes_in_brigade >= THRESHOLD_MIN_WRITE) {
apr_status_t rv = send_brigade_nonblocking(net->client_socket, bb,
&(ctx->bytes_written), c);
if ((rv != APR_SUCCESS) && (!APR_STATUS_IS_EAGAIN(rv))) {
- return rv;
+ /* The client aborted the connection */
+ c->aborted = 1;
+ return APR_SUCCESS;
}
}
Index: server/core_filters.c
===================================================================
--- server/core_filters.c (Revision 366181)
+++ server/core_filters.c (Arbeitskopie)
@@ -413,11 +413,12 @@
if (new_bb == NULL) {
apr_status_t rv = send_brigade_nonblocking(net->client_socket, bb,
&(ctx->bytes_written), c);
- if (APR_STATUS_IS_EAGAIN(rv)) {
- rv = APR_SUCCESS;
+ if ((rv != APR_SUCCESS) && !APR_STATUS_IS_EAGAIN(rv)) {
+ /* The client aborted the connection */
+ c->aborted = 1;
}
setaside_remaining_output(f, ctx, bb, 0, c);
- return rv;
+ return APR_SUCCESS;
}
bytes_in_brigade = 0;
@@ -430,7 +431,9 @@
apr_status_t rv = send_brigade_blocking(net->client_socket, bb,
&(ctx->bytes_written), c);
if (rv != APR_SUCCESS) {
- return rv;
+ /* The client aborted the connection */
+ c->aborted = 1;
+ return APR_SUCCESS;
}
bb = remainder;
next = APR_BRIGADE_FIRST(bb);
@@ -464,14 +467,18 @@
apr_status_t rv = send_brigade_blocking(net->client_socket, bb,
&(ctx->bytes_written), c);
if (rv != APR_SUCCESS) {
- return rv;
+ /* The client aborted the connection */
+ c->aborted = 1;
+ return APR_SUCCESS;
}
}
else if (bytes_in_brigade >= THRESHOLD_MIN_WRITE) {
apr_status_t rv = send_brigade_nonblocking(net->client_socket, bb,
&(ctx->bytes_written), c);
if ((rv != APR_SUCCESS) && (!APR_STATUS_IS_EAGAIN(rv))) {
- return rv;
+ /* The client aborted the connection */
+ c->aborted = 1;
+ return APR_SUCCESS;
}
}