From 7dbc9b9d959297e2305ce67e36439b0472a71f6a Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 3 Jan 2012 15:11:51 -0700 Subject: [PATCH] Bug 3085: Crash when parsing esi:include --- src/client_side_request.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 6fdcde9b6b..531e437859 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -873,18 +873,22 @@ clientInterpretRequestHeaders(ClientHttpRequest * http) request->flags.auth = 1; ConnStateData *http_conn = http->getConn(); - assert(http_conn); - request->flags.connection_auth_disabled = http_conn->port->connection_auth_disabled; - if (!request->flags.connection_auth_disabled) { - if (http_conn->pinning.fd != -1) { - if (http_conn->pinning.auth) { - request->flags.connection_auth = 1; - request->flags.auth = 1; - } else { - request->flags.connection_proxy_auth = 1; + if (http_conn) { + request->flags.connection_auth_disabled = http_conn->port->connection_auth_disabled; + if (!request->flags.connection_auth_disabled) { + if (http_conn->pinning.fd != -1) { + if (http_conn->pinning.auth) { + request->flags.connection_auth = 1; + request->flags.auth = 1; + } else { + request->flags.connection_proxy_auth = 1; + } + request->setPinnedConnection(http_conn); } - request->setPinnedConnection(http_conn); } + } else { + // internal requests and ESI don't have client conn. + request->flags.connection_auth_disabled = 1; } /* check if connection auth is used, and flag as candidate for pinning -- 2.47.2