summaryrefslogtreecommitdiffstats
path: root/perl/perl-SOAP-Lite/SOAP-Lite-0.712_sysread.patch
blob: 85289fcadaad2a128af16a5408c05530c7311819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 8f49c0e970261f59bc043a8104a9a730ec69dcf4 Mon Sep 17 00:00:00 2001
From: Christian Ruppert <idl0r@gentoo.org>
Date: Wed, 23 Mar 2011 18:04:19 +0100
Subject: [PATCH] Use read() instead of sysread() when using mod_perl

https://rt.cpan.org/Public/Bug/Display.html?id=58538
---
 lib/SOAP/Transport/HTTP.pm |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/SOAP/Transport/HTTP.pm b/lib/SOAP/Transport/HTTP.pm
index f16b990..57ebbf3 100644
--- a/lib/SOAP/Transport/HTTP.pm
+++ b/lib/SOAP/Transport/HTTP.pm
@@ -566,9 +566,17 @@ sub handle {
         if ( !$chunked ) {
             my $buffer;
             binmode(STDIN);
-            while ( sysread( STDIN, $buffer, $length ) ) {
-                $content .= $buffer;
-                last if ( length($content) >= $length );
+            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 );
+                }
             }
         }
 
-- 
1.7.3.4