You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2001/04/23 23:03:49 UTC
cvs commit: httpd-proxy/module-2.0 proxy_ftp.c proxy_http.c proxy_util.c
minfrin 01/04/23 14:03:48
Modified: module-2.0 proxy_ftp.c proxy_http.c proxy_util.c
Log:
Apply changes to ap_get_brigade() to the proxy code.
Revision Changes Path
1.50 +1 -4 httpd-proxy/module-2.0/proxy_ftp.c
Index: proxy_ftp.c
===================================================================
RCS file: /home/cvs/httpd-proxy/module-2.0/proxy_ftp.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- proxy_ftp.c 2001/04/15 20:26:10 1.49
+++ proxy_ftp.c 2001/04/23 21:03:34 1.50
@@ -1561,9 +1561,6 @@
/* send response */
r->sent_bodyct = 1;
- /* read till EOF */
- c->remain = -1;
-
if (parms[0] == 'd') {
/* insert directory filter */
ap_add_output_filter("PROXY_SEND_DIR", NULL, r, r->connection);
@@ -1576,7 +1573,7 @@
"proxy: FTP: start body send");
/* read the body, pass it to the output filters */
- while (ap_get_brigade(remote->input_filters, bb, AP_MODE_BLOCKING) == APR_SUCCESS) {
+ while (ap_get_brigade(remote->input_filters, bb, AP_MODE_BLOCKING, -1) == APR_SUCCESS) {
if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
e = apr_bucket_flush_create();
APR_BRIGADE_INSERT_TAIL(bb, e);
1.63 +5 -3 httpd-proxy/module-2.0/proxy_http.c
Index: proxy_http.c
===================================================================
RCS file: /home/cvs/httpd-proxy/module-2.0/proxy_http.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- proxy_http.c 2001/04/19 21:18:41 1.62
+++ proxy_http.c 2001/04/23 21:03:37 1.63
@@ -744,6 +744,7 @@
/* send body */
if (!r->header_only) {
const char *buf;
+ apr_size_t remain;
/* if chunked - insert DECHUNK filter */
if (ap_proxy_liststr((buf = apr_table_get(r->headers_out, "Transfer-Encoding")), "chunked")) {
@@ -753,11 +754,12 @@
apr_table_set(r->headers_out, "Transfer-Encoding", buf);
}
ap_add_input_filter("DECHUNK", NULL, rp, origin);
+ remain = -1;
}
/* if content length - set the length to read */
else if ((buf = apr_table_get(r->headers_out, "Content-Length"))) {
- origin->remain = atol(buf);
+ remain = atol(buf);
}
/* no chunked / no length therefore read till EOF and cancel keepalive */
@@ -767,14 +769,14 @@
/* if keepalive cancelled, read to EOF */
if (close) {
- origin->remain = -1;
+ remain = -1;
}
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
"proxy: start body send");
/* read the body, pass it to the output filters */
- while (ap_get_brigade(rp->input_filters, bb, AP_MODE_BLOCKING) == APR_SUCCESS) {
+ while (ap_get_brigade(rp->input_filters, bb, AP_MODE_BLOCKING, remain) == APR_SUCCESS) {
if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
e = apr_bucket_flush_create();
APR_BRIGADE_INSERT_TAIL(bb, e);
1.55 +2 -5 httpd-proxy/module-2.0/proxy_util.c
Index: proxy_util.c
===================================================================
RCS file: /home/cvs/httpd-proxy/module-2.0/proxy_util.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- proxy_util.c 2001/04/14 07:03:00 1.54
+++ proxy_util.c 2001/04/23 21:03:39 1.55
@@ -1096,14 +1096,11 @@
buff[0] = 0;
*eos = 0;
- /* get line-at-a-time */
- c->remain = 0;
-
/* loop through each brigade */
while (!found) {
- /* get brigade from network */
- if (APR_SUCCESS != (rv = ap_get_brigade(c->input_filters, bb, AP_MODE_BLOCKING))) {
+ /* get brigade from network one line at a time */
+ if (APR_SUCCESS != (rv = ap_get_brigade(c->input_filters, bb, AP_MODE_BLOCKING, 0))) {
return rv;
}