comparison src/http/modules/perl/ngx_http_perl_module.c @ 320:1e9e2c5e7c14 NGINX_0_5_30

nginx 0.5.30 *) Feature: the $args variable can be set with the "set" directive. *) Feature: the $is_args variable. *) Bugfix: if a client has closed connection to mail proxy then nginx might not close connection to backend. *) Bugfix: now nginx escapes space in $memcached_key variable. *) Bugfix: a segmentation fault might occur in worker process when the HTTPS protocol was used in the "proxy_pass" directive. *) Bugfix: the perl $$ variable value in ngx_http_perl_module was equal to the master process identification number. *) Bugfix: fix building on Solaris/amd64 by Sun Studio 11 and early versions; bug appeared in 0.5.29.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Jul 2007 00:00:00 +0400
parents 55328d69b335
children 26ff8d6b618d
comparison
equal deleted inserted replaced
319:10d5a311cc5e 320:1e9e2c5e7c14
65 65
66 #if (NGX_HAVE_PERL_MULTIPLICITY) 66 #if (NGX_HAVE_PERL_MULTIPLICITY)
67 static void ngx_http_perl_cleanup_perl(void *data); 67 static void ngx_http_perl_cleanup_perl(void *data);
68 #endif 68 #endif
69 69
70 static ngx_int_t ngx_http_perl_init_worker(ngx_cycle_t *cycle);
70 static void ngx_http_perl_exit(ngx_cycle_t *cycle); 71 static void ngx_http_perl_exit(ngx_cycle_t *cycle);
71 72
72 73
73 static ngx_command_t ngx_http_perl_commands[] = { 74 static ngx_command_t ngx_http_perl_commands[] = {
74 75
124 &ngx_http_perl_module_ctx, /* module context */ 125 &ngx_http_perl_module_ctx, /* module context */
125 ngx_http_perl_commands, /* module directives */ 126 ngx_http_perl_commands, /* module directives */
126 NGX_HTTP_MODULE, /* module type */ 127 NGX_HTTP_MODULE, /* module type */
127 NULL, /* init master */ 128 NULL, /* init master */
128 NULL, /* init module */ 129 NULL, /* init module */
129 NULL, /* init process */ 130 ngx_http_perl_init_worker, /* init process */
130 NULL, /* init thread */ 131 NULL, /* init thread */
131 NULL, /* exit thread */ 132 NULL, /* exit thread */
132 NULL, /* exit process */ 133 NULL, /* exit process */
133 ngx_http_perl_exit, /* exit master */ 134 ngx_http_perl_exit, /* exit master */
134 NGX_MODULE_V1_PADDING 135 NGX_MODULE_V1_PADDING
1002 1003
1003 return NGX_CONF_OK; 1004 return NGX_CONF_OK;
1004 } 1005 }
1005 1006
1006 1007
1008 static ngx_int_t
1009 ngx_http_perl_init_worker(ngx_cycle_t *cycle)
1010 {
1011 ngx_http_perl_main_conf_t *pmcf;
1012
1013 pmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_perl_module);
1014
1015 {
1016
1017 dTHXa(pmcf->perl);
1018 PERL_SET_CONTEXT(pmcf->perl);
1019
1020 /* set worker's $$ */
1021
1022 sv_setiv(GvSV(gv_fetchpv("$", TRUE, SVt_PV)), (I32) ngx_pid);
1023
1024 }
1025
1026 return NGX_OK;
1027 }
1028
1007 static void 1029 static void
1008 ngx_http_perl_exit(ngx_cycle_t *cycle) 1030 ngx_http_perl_exit(ngx_cycle_t *cycle)
1009 { 1031 {
1010 PERL_SYS_TERM(); 1032 PERL_SYS_TERM();
1011 } 1033 }