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: 53628
Status: rejected
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: MARKSTOS [...] cpan.org
Cc: miyagawa [...] bulknews.net
AdminCc:

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



CC: miyagawa [...] bulknews.net
Subject: wish: consider refactoring 'read_from_stdin' to make it easier to swap out STDIN
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 867
Download (untitled) / with headers
text/plain 867b
Currently, 'CGI::read_from_stdin()' contains this code: if ( $MOD_PERL ) { $res = $self->r->read($tempbuf, $bufsiz, 0) } else { $res = read(\*STDIN, $tempbuf, $bufsiz); } ### Then CGI::PSGI came along and wanted to read from a source other than these two. So, it overloads 'read_from_stdin()' to essentially change one line: $res = $self->{psgi_env}{'psgi.input'}->read($tempbuf, $bufsiz, 0); But now we've found a bug in 'read_from_stdin()', so we have some changes to it in 'git' (currently just in Yanick's branch), Once released, CGI::PSGI will need to be patched as well (and any other module that takes the same approach). My proposal is to to make a routine that encapsulates the if/else logic above. Then, CGI::PSGI could override just that. Also, it's step towards further isolating mod_perl-specific logic in CGI.pm.
X-RT-Interface: REST
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
RT-Message-ID: <rt-4.0.18-18639-1400760393-1300.53628-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 240
Download (untitled) / with headers
text/plain 240b
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/65 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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-10219-1403985482-209.53628-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 579
Download (untitled) / with headers
text/plain 579b
d8277a5 killed the read_from_stdin subroutine. The above behaviour can be found in the read_from_client subroutine: sub read_from_client { my($self, $buff, $len, $offset) = @_; local $^W=0; # prevent a warning return $MOD_PERL ? $self->r->read($$buff, $len, $offset) : read(\*STDIN, $$buff, $len, $offset); } So either this issue is no longer relevant, or the method has been simplified so much that i would suggest monkey patching it if you need it to do something different. Closing, please comment if this issue is still relevant.


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.