]> granicus.if.org Git - apache/commitdiff
Make the core access the socket directly instead of going through the
authorRyan Bloom <rbb@apache.org>
Wed, 18 Oct 2000 19:32:30 +0000 (19:32 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 18 Oct 2000 19:32:30 +0000 (19:32 +0000)
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

modules/http/http_core.c
modules/http/http_protocol.c

index f30a61c48617d55b7de4afd5bea88aee706a614e..ad0b1ad295090d3719b89a8dd52e89bbffb93081 100644 (file)
@@ -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);
         }
index dfaac63145a3792bed59777e7c74d4ac0c1bce14..aa49741e25b61a21b73c15ec4681fa50e7f22946 100644 (file)
@@ -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));