From: Ryan Bloom Date: Thu, 9 Nov 2000 00:37:06 +0000 (+0000) Subject: Remove BUFF from the main server. :-) The buff code needs to remain as X-Git-Tag: APACHE_2_0_ALPHA_8~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ee1d8eb592a5bfb744c6e6a4175b50a7d52703b;p=apache Remove BUFF from the main server. :-) The buff code needs to remain as a part of the server until the proxy is purged of BUFF however. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86878 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 59335e05b5..988469d7f0 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/10/28 14:57:36 $] +Last modified at [$Date: 2000/11/09 00:36:39 $] Release: @@ -18,7 +18,11 @@ RELEASE SHOWSTOPPERS: Status: patch brought forward from 1.3.14 WIN32 and OS2 need review [William Rowe, Brian Harvard] - * Remove Buff from the code. Convert the remaining calls to ap_b***(). + * Remove Buff from the code. + Status: Buff has been removed from the core completely, but the + proxy module is still using it. As soon as the new proxy + patches are committed, Buff should be removed from the proxy + as well. * Error messages are filtered according to the needs of the original URI. Nothing ensures that they are translated on EBCDIC machines diff --git a/include/httpd.h b/include/httpd.h index 6aa52234e6..0f68fae9ed 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -82,7 +82,6 @@ extern "C" { #include "apr_lib.h" #include "apr_time.h" #include "apr_network_io.h" -#include "buff.h" #include "ap_mmn.h" #ifdef HAVE_NETINET_IN_H @@ -833,7 +832,6 @@ struct conn_rec { /* Information about the connection itself */ /** Connection to the client */ - BUFF *client; apr_socket_t *client_socket; /* Who is the client? */ diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index cbfc8e05af..b440b4e69f 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1169,11 +1169,23 @@ static int read_request_line(request_rec *r) * read(). B_SAFEREAD ensures that the BUFF layer flushes if it will * have to block during a read. */ +#if 0 + /* XXX: I am 99% sure that these are already taken care of, but I want to + * really investigate them still. Removing them from the code doesn't + * hurt however, because nothing is using BUFF anymore. + */ ap_bsetflag(conn->client, B_SAFEREAD, 1); ap_bflush(conn->client); +#endif while ((len = getline(l, sizeof(l), r, 0)) <= 0) { if (len < 0) { /* includes EOF */ +#if 0 + /* XXX: I am 99% sure that these are already taken care of, but I want to + * really investigate them still. Removing them from the code doesn't + * hurt however, because nothing is using BUFF anymore. + */ ap_bsetflag(conn->client, B_SAFEREAD, 0); +#endif /* this is a hack to make sure that request time is set, * it's not perfect, but it's better than nothing */ @@ -1194,7 +1206,13 @@ static int read_request_line(request_rec *r) #endif */ +#if 0 + /* XXX: I am 99% sure that these are already taken care of, but I want to + * really investigate them still. Removing them from the code doesn't + * hurt however, because nothing is using BUFF anymore. + */ ap_bsetflag(conn->client, B_SAFEREAD, 0); +#endif r->request_time = apr_now(); r->the_request = apr_pstrdup(r->pool, l); diff --git a/server/connection.c b/server/connection.c index b6a1b1a53c..50ce7cbe5b 100644 --- a/server/connection.c +++ b/server/connection.c @@ -274,8 +274,6 @@ conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server, const struct sockaddr_in *saddr, long id) { conn_rec *conn = (conn_rec *) apr_pcalloc(p, sizeof(conn_rec)); - BUFF *conn_io = ap_bcreate(p, B_RDWR); - ap_bpush_socket(conn_io, inout); /* Got a connection structure, so initialize what fields we can * (the rest are zeroed out by pcalloc). @@ -288,7 +286,6 @@ conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server, conn->local_addr = *saddr; apr_get_local_ipaddr(&conn->local_ip, inout); conn->base_server = server; - conn->client = conn_io; conn->client_socket = inout; conn->remote_addr = *remaddr; diff --git a/server/mpm/mpmt_pthread/scoreboard.c b/server/mpm/mpmt_pthread/scoreboard.c index 62cd5c905c..441a7c728e 100644 --- a/server/mpm/mpmt_pthread/scoreboard.c +++ b/server/mpm/mpmt_pthread/scoreboard.c @@ -184,26 +184,21 @@ void update_scoreboard_global(void) void increment_counts(int child_num, int thread_num, request_rec *r) { - long int bs = 0; thread_score *ss; ss = &ap_scoreboard_image->servers[child_num][thread_num]; - if (r->sent_bodyct) - ap_bgetopt(r->connection->client, BO_BYTECT, &bs); - #ifdef HAVE_TIMES times(&ss->times); #endif ss->access_count++; ss->my_access_count++; ss->conn_count++; - ss->bytes_served += (unsigned long) bs; - ss->my_bytes_served += (unsigned long) bs; - ss->conn_bytes += (unsigned long) bs; + ss->bytes_served += r->bytes_sent; + ss->my_bytes_served += r->bytes_sent; + ss->conn_bytes += r->bytes_sent; put_scoreboard_info(child_num, thread_num, ss); - } AP_DECLARE(int) find_child_by_pid(apr_proc_t *pid) diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index c5783f0451..ffeefc1412 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -494,24 +494,20 @@ void ap_time_process_request(int child_num, int status) /* static void increment_counts(int child_num, request_rec *r) { - long int bs = 0; short_score *ss; ap_sync_scoreboard_image(); ss = &ap_scoreboard_image->servers[child_num]; - if (r->sent_bodyct) - ap_bgetopt(r->connection->client, BO_BYTECT, &bs); - #ifdef HAVE_TIMES times(&ss->times); #endif ss->access_count++; ss->my_access_count++; ss->conn_count++; - ss->bytes_served += (unsigned long) bs; - ss->my_bytes_served += (unsigned long) bs; - ss->conn_bytes += (unsigned long) bs; + ss->bytes_served += r->bytes_sent; + ss->my_bytes_served += r->bytes_sent; + ss->conn_bytes += r->bytes_sent; put_scoreboard_info(child_num, ss); } diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 11c7d93d65..83b87e74de 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -318,23 +318,19 @@ void ap_time_process_request(int child_num, int status) /* TODO: call me some time */ static void increment_counts(int child_num, request_rec *r) { - long int bs = 0; short_score *ss; ss = &ap_scoreboard_image->servers[child_num]; - if (r->sent_bodyct) - ap_bgetopt(r->connection->client, BO_BYTECT, &bs); - #ifdef HAVE_TIMES times(&ss->times); #endif ss->access_count++; ss->my_access_count++; ss->conn_count++; - ss->bytes_served += (unsigned long) bs; - ss->my_bytes_served += (unsigned long) bs; - ss->conn_bytes += (unsigned long) bs; + ss->bytes_served += r->bytes_sent; + ss->my_bytes_served += r->bytes_sent; + ss->conn_bytes += r->bytes_sent; } static int find_child_by_tid(int tid)