Changeset 235e109 in mod_gnutls
- Timestamp:
- Apr 9, 2018, 2:24:59 AM (5 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, master, proxy-ticket, upstream
- Children:
- 23e98b3
- Parents:
- fe21671
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_hooks.c
rfe21671 r235e109 22 22 #include "gnutls_cache.h" 23 23 #include "gnutls_ocsp.h" 24 #include "gnutls_util.h" 24 25 #include "http_vhost.h" 25 26 #include "ap_mpm.h" … … 957 958 static void create_gnutls_handle(conn_rec * c) 958 959 { 959 /* Get mod_gnutls server configuration */960 mgs_srvconf_rec *sc = (mgs_srvconf_rec *)961 ap_get_module_config(c->base_server->module_config, &gnutls_module);962 963 960 _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__); 964 961 965 962 /* Get connection specific configuration */ 966 mgs_handle_t *ctxt = (mgs_handle_t *) ap_get_module_config(c->conn_config, &gnutls_module); 967 if (ctxt == NULL) 968 { 969 ctxt = apr_pcalloc(c->pool, sizeof (*ctxt)); 970 ap_set_module_config(c->conn_config, &gnutls_module, ctxt); 971 ctxt->is_proxy = GNUTLS_ENABLED_FALSE; 972 } 963 mgs_handle_t *ctxt = init_gnutls_ctxt(c); 973 964 ctxt->enabled = GNUTLS_ENABLED_TRUE; 974 ctxt->c = c;975 ctxt->sc = sc;976 965 ctxt->status = 0; 977 966 ctxt->input_rc = APR_SUCCESS; -
src/gnutls_util.c
rfe21671 r235e109 126 126 return rv; 127 127 } 128 129 130 131 mgs_handle_t *init_gnutls_ctxt(conn_rec *c) 132 { 133 mgs_handle_t *ctxt = (mgs_handle_t *) 134 ap_get_module_config(c->conn_config, &gnutls_module); 135 if (ctxt == NULL) 136 { 137 ctxt = apr_pcalloc(c->pool, sizeof (*ctxt)); 138 ap_set_module_config(c->conn_config, &gnutls_module, ctxt); 139 140 /* Get mod_gnutls server configuration */ 141 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) 142 ap_get_module_config(c->base_server->module_config, 143 &gnutls_module); 144 145 /* Set up connection and server references */ 146 ctxt->c = c; 147 ctxt->sc = sc; 148 /* Default, unconditionally changed in proxy setup functions */ 149 ctxt->is_proxy = GNUTLS_ENABLED_FALSE; 150 } 151 return ctxt; 152 } -
src/gnutls_util.h
rfe21671 r235e109 21 21 #include <apr_uri.h> 22 22 #include <gnutls/gnutls.h> 23 #include "mod_gnutls.h" 23 24 24 25 #ifndef __MOD_GNUTLS_UTIL_H__ … … 67 68 __attribute__((nonnull)); 68 69 70 /** 71 * Allocate the connection configuration structure if necessary, set 72 * some defaults. 73 */ 74 mgs_handle_t *init_gnutls_ctxt(conn_rec *c); 75 69 76 #endif /* __MOD_GNUTLS_UTIL_H__ */ -
src/mod_gnutls.c
rfe21671 r235e109 20 20 #include "mod_gnutls.h" 21 21 #include "gnutls_ocsp.h" 22 #include "gnutls_util.h" 22 23 23 24 #ifdef APLOG_USE_MODULE … … 107 108 108 109 /* disable TLS for this connection */ 109 mgs_handle_t *ctxt = (mgs_handle_t *) 110 ap_get_module_config(c->conn_config, &gnutls_module); 111 if (ctxt == NULL) 112 { 113 ctxt = apr_pcalloc(c->pool, sizeof (*ctxt)); 114 ap_set_module_config(c->conn_config, &gnutls_module, ctxt); 115 } 110 mgs_handle_t *ctxt = init_gnutls_ctxt(c); 116 111 ctxt->enabled = GNUTLS_ENABLED_FALSE; 117 112 ctxt->is_proxy = GNUTLS_ENABLED_TRUE; … … 139 134 140 135 /* enable TLS for this connection */ 141 mgs_handle_t *ctxt = (mgs_handle_t *) 142 ap_get_module_config(c->conn_config, &gnutls_module); 143 if (ctxt == NULL) 144 { 145 ctxt = apr_pcalloc(c->pool, sizeof (*ctxt)); 146 ap_set_module_config(c->conn_config, &gnutls_module, ctxt); 147 } 136 mgs_handle_t *ctxt = init_gnutls_ctxt(c); 148 137 ctxt->enabled = GNUTLS_ENABLED_TRUE; 149 138 ctxt->is_proxy = GNUTLS_ENABLED_TRUE;
Note: See TracChangeset
for help on using the changeset viewer.