Subject: | print to output handle erroneously returns reference to FCGI::Stream instead of boolean |
When print()ing to my output handle under FCGI, print always returns a
reference to FCGI::Stream instead of 1 or undef. print should return
undef if the output socket is closed (such as if the browser hit the
stop button and for some reason we got ECONNRESET instead of EPIPE.
The tied PRINT method seems to be to blame for the incorrect return
value of print(). Patch is included below. Thanks.
diff -ru FCGI-0.71/FCGI.XL FCGI-0.71-patched/FCGI.XL
--- FCGI-0.71/FCGI.XL 2010-02-28 07:11:22.000000000 -0700
+++ FCGI-0.71-patched/FCGI.XL 2010-05-20 22:56:08.000000000 -0700
@@ -558,6 +558,8 @@
ok = FALSE;
RETVAL = ok ? &PL_sv_yes : &PL_sv_undef;
+ OUTPUT:
+ RETVAL
int
WRITE(stream, bufsv, len, ...)