in reply to Re^5: Problem with CGI::Vars
in thread Problem with CGI::Vars

Yes I can, but we use this library... The code in new version of this function is the same! Tell me why they read from STDIN by read function and they didn't check how many bytes function read? This is the basics... The problem is in file: CGI.pm in this function:
if ($meth eq 'POST') { $self->read_from_client(\$query_string,$content_length,0) if $content_length > 0; # Some people want to have their cake and eat it too! # Uncomment this line to have the contents of the query string # APPENDED to the POST data. #$query_string .= (length($query_string) ? '&' : '') . $ENV{'QUERY_S +TRING'} if defined $ENV{'QUERY_STRING'}; last METHOD; }
As I checked by debug prints, function read only 10000 bytes, and 3100 bytes keeps unreaded. This function have to be in while cycle....

Replies are listed 'Best First'.
Re^7: Problem with CGI::Vars
by Corion (Patriarch) on Jun 07, 2011 at 13:03 UTC

    At least CGI v3.35 has this code, which is different from the code you show:

    if ($meth eq 'POST' || $meth eq 'PUT') { if ( $content_length > 0 ) { $self->read_from_client(\$query_string,$content_length,0); } elsif (not defined $ENV{CONTENT_LENGTH}) { $self->read_from_stdin(\$query_string); # should this be PUTDATA in case of PUT ? my($param) = $meth . 'DATA' ; $self->add_parameter($param) ; push (@{$self->{param}{$param}},$query_string); undef $query_string ; } # Some people want to have their cake and eat it too! # Uncomment this line to have the contents of the query string # APPENDED to the POST data. # $query_string .= (length($query_string) ? '&' : '') . $ENV{'QU +ERY_STRING'} if defined $ENV{'QUERY_STRING'}; last METHOD; }

    If you're using an old version of CGI.pm it makes little sense to complain about bugs in the old version when a newer version which is different is available.

      OK it is different, but also there is only one read_from_client call!!! If read_from_client function doesn't read whole input, then problem is not solved too...

        The error would only be there if $content_length is wrong.

        So far, you haven't shown code that reproduces the problem. Please show code that reproduces the problem - all other diagnosis will remain vague guesswork.

Re^7: Problem with CGI::Vars
by Anonymous Monk on Jun 07, 2011 at 13:08 UTC
    Yes I can, but we use this library... The code in new version of this function is the same! Tell me why they read from STDIN by read function and they didn't check how many bytes function read? This is the basics... The problem is in file: CGI.pm in this function:

    Um, no. Let me repeat that: no.

    There is no point in quoting bits and pieces of some old version of CGI.pm.

    On the other hand, there is no point in quoting bits and pieces of CGI.pm at all.

    You think you found a bug? Great, submit a proper bug report to the CGI maintainer. What version of CGI.pm do you have installed?

      Version of CGI.pm: 3.15 Perl version: v5.8.8 built for x86_64-linux-thread-multi Web server: MiniServ/1.530 OS: Linux vmluh03 2.6.32lb.11.kvmguest #1 SMP PREEMPT Tue Apr 6 12:56:36 CEST 2010 x86_64 x86_64 x86_64 GNU/Linux
        Version 3.15 was released on Dec 7, 2005. It is unsupported. UPGRADE!
      By the way: I reported bug, but no response from CGI maintainer..
        By the way: I reported bug, but no response from CGI maintainer..

        Why would you expect someone to respond instantly?