Bug 62960 - A patch for SOAP::Transport::HTTP in mod_perl environment

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@709 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2010-04-16 21:55:20 +00:00
parent 4f604ef7a1
commit 57f3566546
1 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,46 @@
--- HTTP.pm 2010-03-18 21:29:10.000000000 +0300
+++ HTTP.pm1 2010-04-17 01:52:42.000000000 +0400
@@ -500,6 +500,13 @@ sub product_tokens {
# ======================================================================
+package SOAP::Transport::HTTP::CGIhack;
+use CGI;
+use vars qw(@ISA);
+@ISA = qw(CGI);
+
+sub init {}
+
package SOAP::Transport::HTTP::CGI;
use vars qw(@ISA);
@@ -533,13 +540,15 @@ sub handle {
my $chunked = (defined $ENV{'HTTP_TRANSFER_ENCODING'}
&& $ENV{'HTTP_TRANSFER_ENCODING'} =~ /^chunked.*$/) || 0;
+ my $r = SOAP::Transport::HTTP::CGIhack->new;
my $content = q{};
if ($chunked) {
my $buffer;
- binmode(STDIN);
- while ( read( STDIN, my $buffer, 1024 ) ) {
+# binmode(STDIN);
+# while ( read( STDIN, my $buffer, 1024 ) ) {
+ while ( $r->read_from_client( \ (my $buffer), 1024 ) ) {
$content .= $buffer;
}
$length = length($content);
@@ -560,8 +569,9 @@ sub handle {
#my $content = q{};
if ( !$chunked ) {
my $buffer;
- binmode(STDIN);
- while ( sysread( STDIN, $buffer, $length ) ) {
+# binmode(STDIN);
+ while ( $r->read_from_client( \$buffer, $length ) ) {
+# while ( sysread( STDIN, $buffer, $length ) ) {
$content .= $buffer;
last if ( length($content) >= $length );
}