From: Ryan Bloom Date: Wed, 18 Oct 2000 19:32:30 +0000 (+0000) Subject: Make the core access the socket directly instead of going through the X-Git-Tag: APACHE_2_0_ALPHA_8~316 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dbda593add62e1c4a03e87a8ad80071f925f9f8;p=apache Make the core access the socket directly instead of going through the BUFF. This doesn't actually change any behavior, it just makes the core access socket directly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86652 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_core.c b/modules/http/http_core.c index f30a61c486..ad0b1ad295 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -2631,7 +2631,7 @@ static apr_status_t send_the_file(conn_rec *c, apr_file_t *fd, for (i = 0; i < hdtr->numheaders; i++) { sendlen += hdtr->headers[i].iov_len; } - rv = writev_it_all(c->client->bsock, hdtr->headers, hdtr->numheaders, + rv = writev_it_all(c->client_socket, hdtr->headers, hdtr->numheaders, sendlen, &bytes_sent); if (rv == APR_SUCCESS) *nbytes += bytes_sent; /* track total bytes sent */ @@ -2650,7 +2650,7 @@ static apr_status_t send_the_file(conn_rec *c, apr_file_t *fd, rv = apr_read(fd, buffer, &sendlen); while (rv == APR_SUCCESS && sendlen) { bytes_sent = sendlen; - rv = apr_send(c->client->bsock, &buffer[o], &bytes_sent); + rv = apr_send(c->client_socket, &buffer[o], &bytes_sent); if (rv == APR_SUCCESS) { sendlen -= bytes_sent; /* sendlen != bytes_sent ==> partial write */ o += bytes_sent; /* o is where we are in the buffer */ @@ -2669,7 +2669,7 @@ static apr_status_t send_the_file(conn_rec *c, apr_file_t *fd, for (i = 0; i < hdtr->numtrailers; i++) { sendlen += hdtr->trailers[i].iov_len; } - rv = writev_it_all(c->client->bsock, hdtr->trailers, hdtr->numtrailers, + rv = writev_it_all(c->client_socket, hdtr->trailers, hdtr->numtrailers, sendlen, &bytes_sent); if (rv == APR_SUCCESS) *nbytes += bytes_sent; @@ -3332,13 +3332,11 @@ static apr_status_t chunk_filter(ap_filter_t *f, ap_bucket_brigade *b) */ static int core_input_filter(ap_filter_t *f, ap_bucket_brigade *b, apr_ssize_t length) { - apr_socket_t *csock = NULL; ap_bucket *e; if (!f->ctx) { /* If we haven't passed up the socket yet... */ f->ctx = (void *)1; - ap_bpop_socket(&csock, f->c->client); - e = ap_bucket_create_socket(csock); + e = ap_bucket_create_socket(f->c->client_socket); AP_BRIGADE_INSERT_TAIL(b, e); return APR_SUCCESS; } @@ -3467,7 +3465,7 @@ static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b) flags |= APR_SENDFILE_DISCONNECT_SOCKET; } nbytes = flen; - rv = apr_sendfile(c->client->bsock, + rv = apr_sendfile(c->client_socket, fd, /* The file to send */ &hdtr, /* Header and trailer iovecs */ &foffset, /* Offset in file to begin sending from */ @@ -3493,7 +3491,7 @@ static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b) #endif } else { - rv = writev_it_all(c->client->bsock, + rv = writev_it_all(c->client_socket, vec, nvec, nbytes, &bytes_sent); } diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index dfaac63145..aa49741e25 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2457,18 +2457,18 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, int bufsiz) do { if (AP_BRIGADE_EMPTY(bb)) { - apr_getsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT, &timeout); - apr_setsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT, 0); + apr_getsocketopt(r->connection->client_socket, APR_SO_TIMEOUT, &timeout); + apr_setsocketopt(r->connection->client_socket, APR_SO_TIMEOUT, 0); if (ap_get_brigade(r->input_filters, bb, 9999) != 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); + apr_setsocketopt(r->connection->client_socket, APR_SO_TIMEOUT, timeout); r->connection->keepalive = -1; ap_brigade_destroy(bb); return -1; } - apr_setsocketopt(r->connection->client->bsock, APR_SO_TIMEOUT, timeout); + apr_setsocketopt(r->connection->client_socket, APR_SO_TIMEOUT, timeout); } b = AP_BRIGADE_FIRST(bb); } while (AP_BRIGADE_EMPTY(bb));