@@ -453,6 +453,7 @@ ngx_http_c_func_proceed_init_calls(ngx_cycle_t* cycle, ngx_http_c_func_srv_conf
453453 ngx_log_error (NGX_LOG_INFO , cycle -> log , 0 , "application initializing" );
454454 /*** Init the apps ***/
455455 ngx_http_c_func_ctx_t new_ctx ; //config request
456+ new_ctx .__pl__ = cycle -> pool ;
456457 new_ctx .__log__ = cycle -> log ;
457458 new_ctx .shared_mem = (void * )mcf -> shm_ctx -> shared_mem ;
458459 func (& new_ctx );
@@ -502,7 +503,7 @@ ngx_http_c_func_post_configuration(ngx_conf_t *cf) {
502503static ngx_int_t
503504ngx_http_c_func_pre_configuration (ngx_conf_t * cf ) {
504505
505- #ifndef ngx_http_c_func_module_version_6
506+ #ifndef ngx_http_c_func_module_version_7
506507 ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 , "%s" , "the latest ngx_http_c_func_module.h not found in the c header path, \
507508 please copy latest ngx_http_c_func_module.h to your /usr/include or /usr/local/include or relavent header search path \
508509 with read and write permission." );
@@ -655,6 +656,7 @@ ngx_http_c_func_process_exit(ngx_cycle_t *cycle) {
655656 ngx_log_error (NGX_LOG_EMERG , cycle -> log , 0 , "Error function call %s" , error );
656657 } else {
657658 ngx_http_c_func_ctx_t new_ctx ; //config request
659+ new_ctx .__pl__ = cycle -> pool ;
658660 new_ctx .__log__ = cycle -> log ;
659661 new_ctx .shared_mem = (void * )mcf -> shm_ctx -> shared_mem ;
660662 func (& new_ctx );
@@ -848,6 +850,7 @@ ngx_http_c_func_content_handler(ngx_http_request_t *r) {
848850
849851 ngx_http_c_func_ctx_t new_ctx ;
850852 new_ctx .__r__ = r ;
853+ new_ctx .__pl__ = r -> pool ;
851854 new_ctx .__log__ = r -> connection -> log ;
852855 new_ctx .shared_mem = (void * )mcf -> shm_ctx -> shared_mem ;
853856
@@ -1118,12 +1121,12 @@ ngx_http_c_func_get_query_param(ngx_http_c_func_ctx_t *ctx, const char *key) {
11181121
11191122void *
11201123ngx_http_c_func_palloc (ngx_http_c_func_ctx_t * ctx , size_t size ) {
1121- return ngx_palloc ( (( ngx_http_request_t * )ctx -> __r__ ) -> pool , size );
1124+ return ngx_palloc ( (ngx_pool_t * )ctx -> __pl__ , size );
11221125}
11231126
11241127void *
11251128ngx_http_c_func_pcalloc (ngx_http_c_func_ctx_t * ctx , size_t size ) {
1126- return ngx_pcalloc ( (( ngx_http_request_t * )ctx -> __r__ ) -> pool , size );
1129+ return ngx_pcalloc ( (ngx_pool_t * )ctx -> __pl__ , size );
11271130}
11281131
11291132uintptr_t
@@ -1228,7 +1231,7 @@ ngx_http_c_func_cache_new(void *shared_mem, const char* key, size_t size) {
12281231 str_key -> data = (u_char * ) ngx_slab_alloc_locked (_cache -> shpool , sizeof (u_char ) * (str_key -> len + 1 ) );
12291232 ngx_memcpy (str_key -> data , key , str_key -> len );
12301233 str_key -> data [str_key -> len ] = 0 ;
1231-
1234+
12321235 uint32_t hash = ngx_crc32_long (str_key -> data , str_key -> len );
12331236
12341237 cvnt -> value = ngx_slab_alloc_locked (_cache -> shpool , size );
0 commit comments