Closed melak closed 7 years ago
So this is what's going on:
Using the method recommended in the docs (i.e. replacing the input file handle with a new IO::Handle), the script never receives the POST data:
$ truss -f -p 56696
56696: accept(3,{ AF_UNIX "" },0x7fffffffe0dc) = 4 (0x4)
56696: select(5,{ 4 },0x0,0x0,{ 2.000000 }) = 1 (0x1)
56696: read(4,"\^A\^A\0\^A\0\b\0\0\0\^A\0\0\0\0"...,8192) = 1160 (0x488)
... then it just hangs here, with the web server timing out eventually,
Leaving input_fh alone (i.e. creating new handles for output_fh and error_fh only), it behaves as expected in every way I can think of:
$ truss -f -p 90376
90376: accept(3,{ AF_UNIX "" },0x7fffffffe0dc) = 4 (0x4)
90376: select(5,{ 4 },0x0,0x0,{ 2.000000 }) = 1 (0x1)
90376: read(4,"\^A\^A\0\^A\0\b\0\0\0\^A\0\0\0\0"...,8192) = 1160 (0x488)
90376: write(4,"\^A\^F\0\^A\0\M-M\^C\0Content-Ty"...,240) = 240 (0xf0)
90376: shutdown(4,SHUT_WR) = 0 (0x0)
90376: select(5,{ 4 },0x0,0x0,{ 2.000000 }) = 1 (0x1)
90376: read(4,0x7fffffffddf0,1024) = 0 (0x0)
90376: close(4) = 0 (0x0)
... and the client gets the output.
Admittedly, I am not completely sure what's going on behind the curtain, this is based on observation mostly - however, befrore -> after is not working -> working.
Are you sure about this? I would expect to have seen this reported a long long time ago in the module if it were a problem given POST requests are going to be fundamental to a lot of peoples use of the module. Perhaps worth writing a test case and bisecting to see if it's a recent regression?
No, I am not, but I currently have no better explanation as to why things are not working with overriding input_fh and do work without. May very well be a skew in my environment, still investigating.
Colleagues (who made me look into this to begin with) have verified that POST suddenly started working once they stopped overriding input_fh. Their environment is guaranteed to be completely different from what I was experimenting with (save for the use of CGI::Fast).
I can't really add anything else to this - as you see fit.
OK, thanks for the investigation. Merged.
v2.12 on its way to CPAN. CI failures are due to issues with ExtUtils::Manifest and perl5.24
This break (at least) POST requests; it also isn't really relevant to the discussion as that's concerned about outputs rather than input.