From: Ralf S. Engelschall Date: Sat, 5 May 2001 19:53:00 +0000 (+0000) Subject: Port ssl_engine_ds.c to APR. X-Git-Tag: 2.0.18~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c46d8a1abbbf3a87120a13552b337d249ce7268;p=thirdparty%2Fapache%2Fhttpd.git Port ssl_engine_ds.c to APR. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89026 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/README b/modules/ssl/README index 29f4e213c90..c32ba52994b 100644 --- a/modules/ssl/README +++ b/modules/ssl/README @@ -29,7 +29,7 @@ - mod_ssl.h ............... common header file of mod_ssl - ssl_engine_config.c ..... module configuration handling # ssl_engine_dh.c ......... DSA/DH support - - ssl_engine_ds.c ......... data structures + # ssl_engine_ds.c ......... data structures - ssl_engine_ext.c ........ Extensions to other Apache parts - ssl_engine_init.c ....... module initialization - ssl_engine_io.c ......... I/O support diff --git a/modules/ssl/mod_ssl.h b/modules/ssl/mod_ssl.h index 16185caee9c..4681b788e0a 100644 --- a/modules/ssl/mod_ssl.h +++ b/modules/ssl/mod_ssl.h @@ -127,6 +127,8 @@ #include "apr.h" #include "apr_fnmatch.h" #include "apr_strings.h" +#include "apr_pools.h" +#include "apr_tables.h" #undef CORE_PRIVATE /* mod_ssl headers */ @@ -200,6 +202,7 @@ #define myCtxVarSet(mc,num,val) mc->rCtx.pV##num = val #define myCtxVarGet(mc,num,type) (type)(mc->rCtx.pV##num) +#endif /* XXX */ /* * SSL Logging @@ -260,22 +263,24 @@ * The own data structures */ typedef struct { - pool *pPool; - pool *pSubPool; - array_header *aData; + apr_pool_t *pPool; + apr_pool_t *pSubPool; + apr_array_header_t *aData; } ssl_ds_array; typedef struct { - pool *pPool; - pool *pSubPool; - array_header *aKey; - array_header *aData; + apr_pool_t *pPool; + apr_pool_t *pSubPool; + apr_array_header_t *aKey; + apr_array_header_t *aData; } ssl_ds_table; /* * Define the certificate algorithm types */ +#if 0 /* XXX */ + typedef int ssl_algo_t; #define SSL_ALGO_UNKNOWN (0) @@ -635,13 +640,13 @@ DH *ssl_dh_GetTmpParam(int); DH *ssl_dh_GetParamFromFile(char *); /* Data Structures */ -ssl_ds_array *ssl_ds_array_make(pool *, int); +ssl_ds_array *ssl_ds_array_make(apr_pool_t *, int); BOOL ssl_ds_array_isempty(ssl_ds_array *); void *ssl_ds_array_push(ssl_ds_array *); void *ssl_ds_array_get(ssl_ds_array *, int); void ssl_ds_array_wipeout(ssl_ds_array *); void ssl_ds_array_kill(ssl_ds_array *); -ssl_ds_table *ssl_ds_table_make(pool *, int); +ssl_ds_table *ssl_ds_table_make(apr_pool_t *, int); BOOL ssl_ds_table_isempty(ssl_ds_table *); void *ssl_ds_table_push(ssl_ds_table *, char *); void *ssl_ds_table_get(ssl_ds_table *, char *); diff --git a/modules/ssl/ssl_engine_ds.c b/modules/ssl/ssl_engine_ds.c index 975646e869f..25fdf20c15f 100644 --- a/modules/ssl/ssl_engine_ds.c +++ b/modules/ssl/ssl_engine_ds.c @@ -63,24 +63,22 @@ -- Unknown */ #include "mod_ssl.h" -#if 0 /* XXX */ - /* _________________________________________________________________ ** ** Data Structures which store _arbitrary_ data ** _________________________________________________________________ */ -ssl_ds_array *ssl_ds_array_make(pool *p, int size) +ssl_ds_array *ssl_ds_array_make(apr_pool_t *p, int size) { ssl_ds_array *a; - if ((a = (ssl_ds_array *)ap_palloc(p, sizeof(ssl_ds_array))) == NULL) + if ((a = (ssl_ds_array *)apr_palloc(p, sizeof(ssl_ds_array))) == NULL) return NULL; a->pPool = p; - if ((a->pSubPool = ap_make_sub_pool(p)) == NULL) + if ((a->pSubPool = apr_pool_sub_make(p, NULL)) != APR_SUCCESS) return NULL; - a->aData = ap_make_array(a->pSubPool, 2, size); + a->aData = apr_array_make(a->pSubPool, 2, size); return a; } @@ -96,7 +94,7 @@ void *ssl_ds_array_push(ssl_ds_array *a) { void *d; - d = (void *)ap_push_array(a->aData); + d = (void *)apr_array_push(a->aData); return d; } @@ -119,23 +117,23 @@ void ssl_ds_array_wipeout(ssl_ds_array *a) void ssl_ds_array_kill(ssl_ds_array *a) { - ap_destroy_pool(a->pSubPool); + apr_pool_destroy(a->pSubPool); a->pSubPool = NULL; a->aData = NULL; return; } -ssl_ds_table *ssl_ds_table_make(pool *p, int size) +ssl_ds_table *ssl_ds_table_make(apr_pool_t *p, int size) { ssl_ds_table *t; - if ((t = (ssl_ds_table *)ap_palloc(p, sizeof(ssl_ds_table))) == NULL) + if ((t = (ssl_ds_table *)apr_palloc(p, sizeof(ssl_ds_table))) == NULL) return NULL; t->pPool = p; - if ((t->pSubPool = ap_make_sub_pool(p)) == NULL) + if ((t->pSubPool = apr_pool_sub_make(p, NULL)) != APR_SUCCESS) return NULL; - t->aKey = ap_make_array(t->pSubPool, 2, MAX_STRING_LEN); - t->aData = ap_make_array(t->pSubPool, 2, size); + t->aKey = apr_array_make(t->pSubPool, 2, MAX_STRING_LEN); + t->aData = apr_array_make(t->pSubPool, 2, size); return t; } @@ -152,9 +150,9 @@ void *ssl_ds_table_push(ssl_ds_table *t, char *key) char *k; void *d; - k = (char *)ap_push_array(t->aKey); - d = (void *)ap_push_array(t->aData); - ap_cpystrn(k, key, t->aKey->elt_size); + k = (char *)apr_array_push(t->aKey); + d = (void *)apr_array_push(t->aData); + apr_cpystrn(k, key, t->aKey->elt_size); return d; } @@ -186,12 +184,10 @@ void ssl_ds_table_wipeout(ssl_ds_table *t) void ssl_ds_table_kill(ssl_ds_table *t) { - ap_destroy_pool(t->pSubPool); + apr_pool_destroy(t->pSubPool); t->pSubPool = NULL; t->aKey = NULL; t->aData = NULL; return; } -#endif /* XXX */ -