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

If i use chk_idx from 1000 to 2000, then I can read chk_idx by param function only from range 1000 to 1762 :-/ Do somebody have any idea?

Replies are listed 'Best First'.
Re^3: Problem with CGI::Vars
by Chipper (Initiate) on Jun 06, 2011 at 10:08 UTC
    If I use print CGI::Dump(), it also show me: # chk_idx * 2001 * 2002 ... * 2762 # ch but I have no ch variable defined, and in Dump() list, variable ch has no value. I think, this can be same problem connected with max POST_PARAM_SIZE in somewhere in CGI, because if I use Webmin::ReadParse, it parses input params correctly.
      ch but I have no ch variable defined, and

      How do you know that?

      use CGI qw(:standart); print CGI::header(); print CGI::start_html('Debug'); print CGI::Dump()."aaaaaaaaa
      "; exit 1; This CGI script only display 2001-2762 params from range 2001-3000 :-(
        This CGI script only display 2001-2762 params from range 2001-3000 :-(

        Look, this script prints all 2001-3000

        print 2001 .. 2762;
      because if I use Webmin::ReadParse, it parses input params correctly.

      Upgrade? View the source? Stick with Webmin::ReadParse?

      I think, I found a BUG in CGI module.... In CGI soucrce code is this function which read only 10000 bytes from 13100 which my browser sends:
      'read_from_client' => <<'END_OF_FUNC', + # Read data from a file handle + 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(\*STDI +N, $$buff, $len, $offset); + } + END_OF_FUNC
      This looks ok, but the function calling looks like, it program some kid:
      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{'QUE +RY_STRING'} if defined $ENV{'QUERY_STRING'}; + last METHOD; + }
      This only read ONCE! from stdin and does NOT check how many bytes it read!! :-( So my read function on my kvm machine read only 10000 bytes from 13100 and thats all :-/

        Please provide a minimal code sample that exhibits the behavior you are describing.

        I think, I found a BUG in CGI module....

        Seeing how thus far, you haven't relayed any version information, it is extremely unlikely you found a bug. The code you copy/pasted doesn't match the current version of CGI module.

        This looks ok, but the function calling looks like, it program some kid:

        You can always write your own

        Is $MOD_PERL true or false? read(\*STDIN, $$buff, 13100, $offset); (as opposed to sysread) should return 13100 chars unless EOF or an error is encountered, but I don't know about the mod_perl method.

        Even if read did act like sysread, there's no way it would return 10000 bytes given that 10000 is not even related to a power of two.

        All signs point to some user-configured (or maybe even hardcoded) limit somewhere not related to read.