Fix xmlrpc with read/sysread clutter

beta
Vitaliy Filippov 2017-09-26 19:08:43 +03:00
parent 257d4b0ebb
commit 155e56dfcb
1 changed files with 3 additions and 11 deletions

View File

@ -76,20 +76,12 @@ sub type {
print "HTTP/1.1 100 Continue\r\n\r\n";
}
#my $content = q{};
if ( !$chunked ) {
my $buffer;
binmode(STDIN);
if ( defined $ENV{'MOD_PERL'} ) {
while ( read( STDIN, $buffer, $length ) ) {
$content .= $buffer;
last if ( length($content) >= $length );
}
} else {
while ( sysread( STDIN, $buffer, $length ) ) {
$content .= $buffer;
last if ( length($content) >= $length );
}
while ( read( STDIN, $buffer, $length ) ) {
$content .= $buffer;
last if ( length($content) >= $length );
}
## Line added so CGI doesn't try to slurp in the POST content after XMLRPC
undef $ENV{CONTENT_LENGTH};