+ o Make the PRINT method return a boolean value rather than the
+ number of bytes written, previous patch was incorrect.
+
Version 0.68_01 -- 10 Jan 2010 <mst@shadowcat.co.uk> Matt S Trout
o Force signal handler installation so that we correctly install handlers
for SIGPIPE. Fixes RT#5100 <bobtfish@bobtfish.net>
sub PRINT {
my ($stream) = shift;
- my $bytes = 0;
for (@_) {
- my $len = length($_);
- $stream->{src}->write($stream->{type}, $_, $len);
- $bytes += $len;
+ $stream->{src}->write($stream->{type}, $_, length($_));
}
- return $bytes;
+ return 1;
}
sub CLOSE {
PREINIT:
int n;
- int retval;
- int bytes_written;
CODE:
- retval = 0;
- bytes_written = 0;
- for (n = 1; n < items && bytes_written >= 0; ++n) {
+ for (n = 1; n < items; ++n) {
STRLEN len;
register char *tmps;
#ifdef DO_UTF8
croak("Wide character in FCGI::Stream::PRINT");
#endif
tmps = (char *)SvPV(ST(n),len);
- bytes_written = FCGX_PutStr(tmps, len, stream);
- if (bytes_written > 0) {
- retval += bytes_written;
- }
+ FCGX_PutStr(tmps, len, stream);
}
if (SvTRUEx(perl_get_sv("|", FALSE)))
FCGX_FFlush(stream);
- RETVAL = retval;
+ RETVAL = 1;
OUTPUT:
RETVAL