1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

Improve traces in ap_proxy_http_process_response().

That will help to investigate PR 37770. (errors from backend :-)).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@549420 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Frederic Clere
2007-06-21 08:01:30 +00:00
parent 57f6aefe6c
commit cd6a6923c2

View File

@@ -1183,6 +1183,28 @@ static int addit_dammit(void *v, const char *key, const char *val)
return 1; return 1;
} }
static
apr_status_t ap_proxygetline(char *s, int n, request_rec *r,
int fold, int *writen)
{
char *tmp_s = s;
apr_status_t rv;
apr_size_t len;
apr_bucket_brigade *tmp_bb;
tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
rv = ap_rgetline(&tmp_s, n, &len, r, fold, tmp_bb);
apr_brigade_destroy(tmp_bb);
if (rv == APR_SUCCESS) {
*writen = (int) len;
} else {
*writen = -1;
}
return rv;
}
static static
apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
proxy_conn_rec *backend, proxy_conn_rec *backend,
@@ -1215,15 +1237,17 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
*/ */
rp->proxyreq = PROXYREQ_RESPONSE; rp->proxyreq = PROXYREQ_RESPONSE;
do { do {
apr_status_t rc;
apr_brigade_cleanup(bb); apr_brigade_cleanup(bb);
len = ap_getline(buffer, sizeof(buffer), rp, 0); rc = ap_proxygetline(buffer, sizeof(buffer), rp, 0, &len);
if (len == 0) { if (len == 0) {
/* handle one potential stray CRLF */ /* handle one potential stray CRLF */
len = ap_getline(buffer, sizeof(buffer), rp, 0); rc = ap_proxygetline(buffer, sizeof(buffer), rp, 0, &len);
} }
if (len <= 0) { if (len <= 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
"proxy: error reading status line from remote " "proxy: error reading status line from remote "
"server %s", backend->hostname); "server %s", backend->hostname);
return ap_proxyerror(r, HTTP_BAD_GATEWAY, return ap_proxyerror(r, HTTP_BAD_GATEWAY,