comparison src/http/modules/perl/ngx_http_perl_module.c @ 248:acd2ec3541cb NGINX_0_4_9

nginx 0.4.9 *) Feature: the "set" parameter in the "include" SSI command. *) Feature: the ngx_http_perl_module now tests the nginx.pm module version.
author Igor Sysoev <http://sysoev.ru>
date Fri, 13 Oct 2006 00:00:00 +0400
parents 38e7b94d63ac
children 6ae1357b7b7c
comparison
equal deleted inserted replaced
247:fcca101509a4 248:acd2ec3541cb
563 static PerlInterpreter * 563 static PerlInterpreter *
564 ngx_http_perl_create_interpreter(ngx_http_perl_main_conf_t *pmcf, 564 ngx_http_perl_create_interpreter(ngx_http_perl_main_conf_t *pmcf,
565 ngx_log_t *log) 565 ngx_log_t *log)
566 { 566 {
567 int n; 567 int n;
568 char *embedding[6]; 568 STRLEN len;
569 SV *sv;
570 char *ver, *embedding[6];
569 PerlInterpreter *perl; 571 PerlInterpreter *perl;
570 572
571 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "create perl interpreter"); 573 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "create perl interpreter");
572 574
573 #if (NGX_HAVE_PERL_CLONE) 575 #if (NGX_HAVE_PERL_CLONE)
629 631
630 n = perl_parse(perl, ngx_http_perl_xs_init, n, embedding, NULL); 632 n = perl_parse(perl, ngx_http_perl_xs_init, n, embedding, NULL);
631 633
632 if (n != 0) { 634 if (n != 0) {
633 ngx_log_error(NGX_LOG_ALERT, log, 0, "perl_parse() failed: %d", n); 635 ngx_log_error(NGX_LOG_ALERT, log, 0, "perl_parse() failed: %d", n);
636 goto fail;
637 }
638
639 sv = get_sv("nginx::VERSION", FALSE);
640 ver = SvPV(sv, len);
641
642 if (ngx_strcmp(ver, NGINX_VERSION) != 0) {
643 ngx_log_error(NGX_LOG_ALERT, log, 0,
644 "version " NGINX_VERSION " of nginx.pm is required, "
645 "but %s was found", ver);
634 goto fail; 646 goto fail;
635 } 647 }
636 648
637 if (ngx_http_perl_run_requires(aTHX_ &pmcf->requires, log) != NGX_OK) { 649 if (ngx_http_perl_run_requires(aTHX_ &pmcf->requires, log) != NGX_OK) {
638 goto fail; 650 goto fail;