Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Unable to read data... in CGI.pm

Quote Reply
Unable to read data... in CGI.pm
I have configured gforum with mod_perl.
When I try to post a message to an forum I receive 'Internal server error 500'.
Without mod_perl all works fine.

apache error log:

[error] GT::CGI::MultiPart (544): Unable to read data from server. Still have 1160 bytes to read, but got 0. Data in buffer is: at .....admin/GT/CGI.pm line 77.

w2k
IE 6.0
apache 1.3.20
mod_perl 1.26

Where a bug? (CGI.pm, apache, mod_perl, w2k, hands.sys?)

Quote Reply
Re: [vvf] Unable to read data... in CGI.pm In reply to
Hi,

Do you have anything else running under mod_perl (Links SQL or Gossamer Mail perhaps)? If so, try taking those out, and run it with just Gossamer Forum loaded.

This site is running under mod_perl, so it should be ok.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Unable to read data... in CGI.pm In reply to
I have tried to delete all unnecessary from the apache configuration.

Problem still persist.
Quote Reply
Re: [vvf] Unable to read data... in CGI.pm In reply to
Hi,

I think we've tracked down the problem. Can you try removing mod_gzip from your Apache's configuration? That fixed it on our Windows server.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Unable to read data... in CGI.pm In reply to
No, I did not use mod_gzip, and any other third-party modules.

I have tried to localize this error:

main(){
GForum::authenticate(){
$IN->param('login_username'){
$self->load_data(){
GT::CGI::MultiPart->parse($self){
$parser->read_body{
$self->read{
fill_buffer ($bytes){

my $bytes_read = read ($self->{fh}, $self->{buffer}, $bytes_to_read, $buffer_length);

On this step &read always return undef, and when $MAX_READS reached, gforum dies. I have temporarily changed '$self {fh}' to 'STDIN', thus the message was successfully posted.

This error occurs only under mod_perl.

Quote Reply
Re: [vvf] Unable to read data... in CGI.pm In reply to
Hi,

Is this on Windows or unix? Can you let me know your perl version, apache version and mod_perl version?

Did changing it to STDIN fix the problem?

Thanks for helping us track this down!

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Unable to read data... in CGI.pm In reply to
Windows 2000 Server and Windows XP 2600
ActiveState Perl 5.6.1 build 628
mod_perl 1.26_01-dev
Apache 1.3.20 compiled with mod_ssl

>Did changing it to STDIN fix the problem?

Yes (I have made this replacement directly before sending of the form).
Whether is it possible to change '$self->{fh}' to 'STDIN' permanently?


Quote Reply
Re: [vvf] Unable to read data... in CGI.pm In reply to
Hi,

Yes, we did a bit more research. It's still broken on mod_gzip with windows and apache, but that seems to be an old mod_gzip bug.

However, for mod_perl it was broken on windows. To fix, you replace:

binmode ($self->{fh});

with:

binmode(main::STDIN);

and:

read ($self->{fh}, $self->{buffer}, $bytes_to_read, $buffer_length);

with

read (main::STDIN, $self->{buffer}, $bytes_to_read, $buffer_length);

We'll have this updated in the next beta due out today.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Unable to read data... in CGI.pm In reply to
Now it works. Thanks.