Re: вопрос по ngx_http_perl_module

Andrey Antonov antonov.andrey at gmail.com
Sun Nov 5 12:24:46 MSK 2006


> > 1. Почему-то не работает $r->has_request_body( $x ), если $x это
> переменная
> > содержащая название процедуры, работает только с константной строкой. И
> > кстати говоря, константная строка должна быть в кавычках, по-другому у
> меня
> > не работает, а в примере который в документации строка без кавычек.
>
> Странно, у меня работают все варианты: и переменная, и строка, и
> просто имя функции без кавычек.


Написал небольшой  тест. Результаты какие-то совсем удивительные, это при
том что сервер на 0.3.61 стоит рядом и работает как часы уже месяц, код весь
практически тот же.

Если браузер MSIE 6.0 или тестовый скрипт который приложен к письму:
1. Строка в переменной и в кавычках выдают такую ошибку в логе:
2006/11/05 12:07:54 [alert] 45251#0: *1 no free perl interpreter, client:
217.67.117.64, server: nginx-test, URL: "/", host: "test", referrer: "
http://test/"

2. Строка без кавычек такую ошибку:
2006/11/05 12:08:37 [error] 45280#0: *1 call_sv("nginx_test::handler")
failed: "Can't call method "request_body" on an undefined value at
/usr/local/nginx-test/cgi-bin/lib/nginx_test.pm line 16.", client:
217.67.117.64, server: nginx-test, URL: "/", host: "test", referrer: "
http://test/"
(те в хендлер не передается $r, список параметров пустой)

Если браузер Opera 9.02 или Firefox 1.5.7:
1. Строка в переменной:
2006/11/05 12:13:42 [error] 45445#0: *1 call_sv("") failed: "Undefined
subroutine &main:: called.", client: 217.67.117.64, server: nginx-test, URL:
"/", host: "test", referrer: "http://test/"

2. Строка без кавычек:
2006/11/05 12:14:36 [error] 45498#0: *1 call_sv("nginx_test::handler")
failed: "Can't call method "request_body" on an undefined value at
/usr/local/nginx-test/cgi-bin/lib/nginx_test.pm line 16.", client:
217.67.117.64, server: nginx-test, URL: "/", host: "test", referrer: "
http://test/"

3. Строка в кавычках работает нормально.

Система freebsd 6.0, nginx-0.4.12, perl 5.8.8, модуль, инфа по перлу, конфиг
и тестовый скрипт прилагаются. Все ошибки у меня повторяемые, кеш браузеров
и тп тоже никакой роли не играют, все это я проверял.

-----
С уважением,
Андрей
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20061105/315f5bca/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx.conf
Type: application/octet-stream
Size: 1367 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20061105/315f5bca/attachment.obj>
-------------- next part --------------
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
    osname=freebsd, osvers=6.0-release, archname=i386-freebsd-64int
    uname='freebsd customer-3946.cit-network.net 6.0-release freebsd 6.0-release #0: mon mar 13 22:05:51 msk 2006 root at customer-3946.cit-network.net:usrsrcsysi386compilemykernel i386 '
    config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.8/mach -Dprivlib=/usr/local/lib/perl5/5.8.8 -Dman3dir=/usr/local/lib/perl5/5.8.8/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.8/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.8 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.8.8/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -Doptimize=-O2 -fno-strict-aliasing -pipe  -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include',
    optimize='-O2 -fno-strict-aliasing -pipe ',
    cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include'
    ccversion='', gccversion='3.4.4 [FreeBSD] 20050518', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -Wl,-E -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lcrypt -lutil
    perllibs=-lm -lcrypt -lutil
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE'
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: MYMALLOC PERL_MALLOC_WRAP USE_64_BIT_INT
                        USE_LARGE_FILES USE_PERLIO
  Locally applied patches:
        defined-or
  Built under freebsd
  Compiled at Mar 24 2006 17:06:53
  @INC:
    /usr/local/lib/perl5/5.8.8/BSDPAN
    /usr/local/lib/perl5/site_perl/5.8.8/mach
    /usr/local/lib/perl5/site_perl/5.8.8
    /usr/local/lib/perl5/site_perl/5.8.7
    /usr/local/lib/perl5/site_perl
    /usr/local/lib/perl5/5.8.8/mach
    /usr/local/lib/perl5/5.8.8
    .
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx_test.pm
Type: application/octet-stream
Size: 648 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20061105/315f5bca/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_nginx.pl
Type: application/octet-stream
Size: 240 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20061105/315f5bca/attachment-0002.obj>


More information about the nginx-ru mailing list