Make the PRINT method return the number of bytes written.
[catagits/fcgi2.git] / perl / FCGI.PL
index 87f2540..4781e86 100644 (file)
@@ -261,9 +261,13 @@ sub READ {
 
 sub PRINT {
     my ($stream) = shift;
+    my $bytes = 0;
     for (@_) {
-       $stream->{src}->write($stream->{type}, $_, length($_));
+        my $len = length($_);
+        $stream->{src}->write($stream->{type}, $_, $len);
+        $bytes += $len;
     }
+    return $bytes;
 }
 
 sub CLOSE {