Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 54055
Status: rejected
Priority: 0/
Queue: CGI

Owner: Nobody in particular
Requestors: JSTENZEL [...]

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


Subject: Patch suggestion: enable reading from an arbitrary handle
Download (untitled) / with headers
text/plain 1.7k
Summary This ticket suggests a patch to read input not only from STDIN but from an arbitrary handle. Description: is used to read input from STDIN. This works perfectly when the script is running under web server control. For proxy solutions, the situation is different as input and output of the final CGI script are received (and written) via a socket. client <===> web server <===> STDIN/STDOUT | cgi-bin/proxy-script <===> socket | script using For this to work for GET *and* POST requests it is required to pass the socket as a parameter to So, I'd like to suggest a patch that adds this feature. The constructor allows to pass a handle parameter already, but (as I understand) this is meant for initialization in order to restore sessions, or to read CGI parameters provided in Boulderio format, not to process client data. So, I added another (optional) constructor parameter. To allow further extensions it is a reference to a hash containing "configuration settings", and is used like so: my $cgi = new CGI(undef, {client_handle => $handle}); The client_handle setting takes a handle to read input from. If this setting is omitted the module should fall back to STDIN as usual. This way, there should be no need to touch existing scripts - existing features should be preserved and initialization via the first parameter should continue to work. Please see the attached patch against 3.48 that adds this functionality. The patched module passes all tests of the original distribution 3.48 and works successfully in a real project (using perl v5.10.0 built for i686-pc-linux-gnu-64int, on Linux Would it be possible to add this feature to the distribution? Thank you in advance Jochen

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 240b
This issue has been copied to: please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
Download (untitled) / with headers
text/plain 203b
I don't think this patch is necessary. CGI takes a file handle as the first argument to the constructor, and this works for both GET and POST requests. t/arbitrary_handles.t has been added to check this.

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

Please report any issues with to