Re: Problem with CGI::Vars
by Corion (Patriarch) on Jun 06, 2011 at 07:55 UTC
|
Are you sure that all values are checked? Have you inspected that your POST request includes the values? Maybe use the Mozilla Live HTTP Headers to inspect the request that gets sent to your CGI script.
| [reply] |
|
|
Yes, I checked by wireshark on client side, params is send correctly. Then I use Webmin function ReadParse and this function return me the %in variable with correct data. But I don't use ReadParse because different problems with this function :D
Data is incoming correctly, there were must be problem with CGI function (maybe some limit?). I don't know why the function return me only 834 values of checkboxes, why not 1000 :-(.
| [reply] |
Re: Problem with CGI::Vars
by Anonymous Monk on Jun 06, 2011 at 08:27 UTC
|
| [reply] |
|
|
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?
| [reply] |
|
|
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.
| [reply] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Problem with CGI::Vars
by ikegami (Patriarch) on Jun 08, 2011 at 18:02 UTC
|
Your hypotheses is that read did a partial read and needs to be called again to get the rest. You've offered no proof of this at all, so let's verify it.
Does adding the following to your script help?
use CGI 3.55;
BEGIN {
*CGI::read_from_client = sub {
my($self, $buff, $len, $offset) = @_;
local $^W=0; # prevent a warning
die if $MOD_PERL;
while ($len) {
my $bytes_read = read(\*STDIN, $$buff, $len, $offset);
die "read: $!\n" if !defined($bytes_read);
last if !$bytes_read;
$len -= $bytes_read;
$offset += $bytes_read;
}
};
}
help? | [reply] [d/l] [select] |
|
|
Yes, this is the problem which I'm talking about all the time... Now it's working great :) But I overwrite the read_from_client function straight in CGI.pm. Now problem is gone. So did I true, this is a bug?
| [reply] |
|
|
Sorry, but I didn't understand you clearly.
If you're saying 10,000 bytes are returned by CGI without the code in Re: Problem with CGI::Vars and you get 13,100 bytes with that code, then yeah, there's a bug. Others may disagree, but I'd say the bug is in Perl (not CGI). That said, the issue can easily be sidestepped by changing CGI.
| [reply] |
|
|
| [reply] |
|
|
|
|