From: Graham Leggett Date: Tue, 9 Apr 2002 09:39:04 +0000 (+0000) Subject: Proxy was bombing out every second keepalive request, caused by a X-Git-Tag: 2.0.36~249 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab32e62ac32df71ac6457e99cfe9f537a08363ac;p=apache Proxy was bombing out every second keepalive request, caused by a stray CRLF before the second response's status line. Proxy now tries to read one more line if it encounters a CRLF where it expected a status. PR: 10010 Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94574 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index b92c4f0346..94c91b2d9d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.36 + *) Proxy was bombing out every second keepalive request, caused by a + stray CRLF before the second response's status line. Proxy now + tries to read one more line if it encounters a CRLF where it + expected a status. PR 10010 [Graham Leggett] + *) Deprecated the apr_lock.h API. Please see the following files for the improved thread and process locking and signaling: apr_proc_mutex.h, apr_thread_mutex.h, apr_thread_rwlock.h, diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index eff26563b4..d7392d35cc 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -661,6 +661,10 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, apr_brigade_cleanup(bb); len = ap_getline(buffer, sizeof(buffer), rp, 0); + if (len == 0) { + /* handle one potential stray CRLF */ + len = ap_getline(buffer, sizeof(buffer), rp, 0); + } if (len <= 0) { apr_socket_close(p_conn->sock); backend->connection = NULL;