Skip Menu |
 

This queue is for tickets about the FCGI CPAN distribution.

Report information
The Basics
Id: 24347
Status: resolved
Priority: 0/
Queue: FCGI

People
Owner: Nobody in particular
Requestors: DDICK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.67
Fixed in: (no value)



Subject: Patch to return correct values when printing output
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1168646786-18001-27"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 127
Download (untitled) / with headers
text/plain 127b
Without this patch, the following code in a CGI script will fail unless(print("HTMLDATA")) { die("Failed to write:$!"); }
Subject: fcgi_print.patch
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1168646786-18001-26"
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: application/octet-stream; name="fcgi_print.patch"
Content-Disposition: inline; filename="fcgi_print.patch"
Content-Transfer-Encoding: base64
Content-Length: 887
Download fcgi_print.patch
text/x-diff 887b
diff -Naur old/FCGI.XL new/FCGI.XL --- old/FCGI.XL 2002-11-12 00:51:20.000000000 +1100 +++ new/FCGI.XL 2007-01-13 09:26:09.000000000 +1100 @@ -529,22 +529,34 @@ #ifndef USE_SFIO -void +int PRINT(stream, ...) FCGI::Stream stream; PREINIT: int n; + int retval; + int bytes_written; CODE: - for (n = 1; n < items; ++n) { + retval = 0; + bytes_written = 0; + for (n = 1; n < items && bytes_written >= 0; ++n) { STRLEN len; register char *tmps = (char *)SvPV(ST(n),len); - FCGX_PutStr(tmps, len, stream); + bytes_written = FCGX_PutStr(tmps, len, stream); + if (bytes_written > 0) { + retval += bytes_written; + } } if (SvTRUEx(perl_get_sv("|", FALSE))) FCGX_FFlush(stream); + RETVAL = retval; + + OUTPUT: + RETVAL + int WRITE(stream, bufsv, len, ...) FCGI::Stream stream;
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-14813-1266275766-485.24347-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 84
An alternate and more correct patch to this issue is present in the latest release.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.