Welcome! Log In Create A New Profile

Advanced

Re: [Nginx] perl module get an empty body

August 10, 2012 10:12AM
OK, so is this better ?

#!/usr/bin/perl

package switcher_test;
use nginx;

use Sys::Syslog;

my $facility = 'local2';

sub handler {
my $r = shift;

return $r->has_request_body(\& test);

}

sub test {
my $r = shift;
if ($r->request_body =~ /.*test.*/) { return 3 };
openlog('switcher', 'ndelay', $facility);
syslog(LOG_DEBUG, 'request_body: '.$r->request_body);
syslog(LOG_DEBUG, 'request_body_file: '.$r->request_body_file);
return 4;
}

1;
__END__


It still doesn't work this way.
Subject Author Posted

[Nginx] perl module get an empty body

darkweaver871 August 10, 2012 06:03AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 06:04AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 07:03AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 09:44AM

Re: [Nginx] perl module get an empty body

Maxim Dounin August 10, 2012 07:14AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 09:46AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 10:12AM

Re: [Nginx] perl module get an empty body

Maxim Dounin August 10, 2012 09:56AM

Re: [Nginx] perl module get an empty body

Maxim Dounin August 10, 2012 01:12PM

Re: [Nginx] perl module get an empty body

darkweaver871 August 12, 2012 06:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 67
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 254 on July 05, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready