From cvs-return-65258-archive-asf-public=cust-asf.ponee.io@httpd.apache.org Mon Mar 18 10:18:57 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6AD33180651 for ; Mon, 18 Mar 2019 11:18:57 +0100 (CET) Received: (qmail 13474 invoked by uid 500); 18 Mar 2019 10:18:56 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 13465 invoked by uid 99); 18 Mar 2019 10:18:56 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Mar 2019 10:18:56 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id BD7E33A1349 for ; Mon, 18 Mar 2019 10:18:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1855748 - /httpd/httpd/trunk/modules/ssl/mod_ssl.c Date: Mon, 18 Mar 2019 10:18:55 -0000 To: cvs@httpd.apache.org From: rpluem@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20190318101855.BD7E33A1349@svn01-us-west.apache.org> Author: rpluem Date: Mon Mar 18 10:18:55 2019 New Revision: 1855748 URL: http://svn.apache.org/viewvc?rev=1855748&view=rev Log: * Solve a chicken and egg problem here: We need to have sslconn->dc set correctly when we want to init sslconn, but we need to allocate memory for it first. Modified: httpd/httpd/trunk/modules/ssl/mod_ssl.c Modified: httpd/httpd/trunk/modules/ssl/mod_ssl.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/mod_ssl.c?rev=1855748&r1=1855747&r2=1855748&view=diff ============================================================================== --- httpd/httpd/trunk/modules/ssl/mod_ssl.c (original) +++ httpd/httpd/trunk/modules/ssl/mod_ssl.c Mon Mar 18 10:18:55 2019 @@ -490,10 +490,25 @@ static SSLConnRec *ssl_init_connection_c int new_proxy) { SSLConnRec *sslconn = myConnConfig(c); + int need_setup = 0; if (!sslconn) { sslconn = apr_pcalloc(c->pool, sizeof(*sslconn)); + need_setup = 1; + } + + /* Reinit dc in any case because it may be r->per_dir_config scoped + * and thus a caller like mod_proxy needs to update it per request. + */ + if (per_dir_config) { + sslconn->dc = ap_get_module_config(per_dir_config, &ssl_module); + } + else { + sslconn->dc = ap_get_module_config(c->base_server->lookup_defaults, + &ssl_module); + } + if (need_setup) { sslconn->server = c->base_server; sslconn->verify_depth = UNSET; if (new_proxy) { @@ -508,17 +523,6 @@ static SSLConnRec *ssl_init_connection_c myConnConfigSet(c, sslconn); } - /* Reinit dc in any case because it may be r->per_dir_config scoped - * and thus a caller like mod_proxy needs to update it per request. - */ - if (per_dir_config) { - sslconn->dc = ap_get_module_config(per_dir_config, &ssl_module); - } - else { - sslconn->dc = ap_get_module_config(c->base_server->lookup_defaults, - &ssl_module); - } - return sslconn; }