Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-10-12 23:55:15 +0400
committerIgor Sysoev <igor@sysoev.ru>2006-10-12 23:55:15 +0400
commit8a444aa7242a294e03f551228152c393a1d68f50 (patch)
treee5a18ba15aefe5bbac9eeb2fb26289f6b70366e3 /src/http/modules/perl/ngx_http_perl_module.c
parentd79b21d1c6c36cf8687336e8b4bde59e9380cab2 (diff)
check nginx.pm version
Diffstat (limited to 'src/http/modules/perl/ngx_http_perl_module.c')
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index e59ece4bb..4fd19485f 100644
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -565,7 +565,9 @@ ngx_http_perl_create_interpreter(ngx_http_perl_main_conf_t *pmcf,
ngx_log_t *log)
{
int n;
- char *embedding[6];
+ STRLEN len;
+ SV *sv;
+ char *ver, *embedding[6];
PerlInterpreter *perl;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "create perl interpreter");
@@ -634,6 +636,16 @@ ngx_http_perl_create_interpreter(ngx_http_perl_main_conf_t *pmcf,
goto fail;
}
+ sv = get_sv("nginx::VERSION", FALSE);
+ ver = SvPV(sv, len);
+
+ if (ngx_strcmp(ver, NGINX_VERSION) != 0) {
+ ngx_log_error(NGX_LOG_ALERT, log, 0,
+ "version " NGINX_VERSION " of nginx.pm is required, "
+ "but %s was found", ver);
+ goto fail;
+ }
+
if (ngx_http_perl_run_requires(aTHX_ &pmcf->requires, log) != NGX_OK) {
goto fail;
}