rbb 00/10/11 22:40:46
Modified: src/main http_protocol.c
Log:
A small cleanup for ap_get_client_block.
Revision Changes Path
1.163 +7 -8 apache-2.0/src/main/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -r1.162 -r1.163
--- http_protocol.c 2000/10/12 04:47:21 1.162
+++ http_protocol.c 2000/10/12 05:40:46 1.163
@@ -2395,7 +2395,6 @@
ap_bucket *b;
ap_bucket_brigade *bb = ap_brigade_create(r->pool);
-
if (!r->read_chunked) { /* Content-length read */
const char *tempbuf;
@@ -2409,15 +2408,15 @@
apr_getsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT,
&timeout);
apr_setsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT,
0);
r->connection->remaining = len_to_read;
- rv = ap_get_brigade(r->input_filters, bb);
- apr_setsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT,
timeout);
- }
- if (AP_BRIGADE_EMPTY(bb)) {
- if (rv != APR_SUCCESS) {
+ if (ap_get_brigade(r->input_filters, bb) != APR_SUCCESS) {
+ /* if we actually fail here, we want to just return and
+ * stop trying to read data from the client.
+ */
+ apr_setsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT,
timeout);
r->connection->keepalive = -1;
return -1;
}
- return 0;
+ apr_setsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT,
timeout);
}
b = AP_BRIGADE_FIRST(bb);
@@ -2445,7 +2444,7 @@
r->remaining -= len_to_read;
return len_to_read;
}
-
+
/*
* Handle chunked reading Note: we are careful to shorten the input
* bufsiz so that there will always be enough space for us to add a CRLF
|