List Info

Thread: post - all empty?




post - all empty?
country flaguser name
Austria
2007-09-07 09:26:56
hi list,

I have a strange problem, that occurs for some clients, for
most not:  
we have a form, that is setup  by javascript dynamically
(form  
consits of one input field, one textarea and 2 hidden
fields)

...
form.setAttribute('action','/cat/postings/post_comment');
form.setAttribute('id','input_form');
form.setAttribute('name','input_form');
form.setAttribute('method','post');
form.setAttribute('enctype','multipart/form-data');
form.setAttribute('accept-charset','utf-8');
form.setAttribute('onSubmit', 'return check(' + parent +
')');
...

as said, most of the time it works without a problem, but
sometimes I  
get the following error:

[error] Caught exception in engine "Wrong
Content-Length value: xxx  
at /usr/local/share/perl/5.8.8/Catalyst.pm line 1636"

which is thrown from Enigne.pm

# paranoia against wrong Content-Length header
my $remaining = $length - $self->read_position;
if ( $remaining > 0 ) {
     $self->finalize_read($c);
     Catalyst::Exception->throw(
        "Wrong Content-Length value: $length" );
}

from debugging I found out, that $remaining in fact is
$length, so it  
seems, that nothing was read from the post body

HTTP::Body is version 0.9, I changed multipart/form-data to 

application/x-www-form-urlencoded, still no effect.
to see the form, you have to be logged in, which works fine,
I can  
identify the user from the session, so cookie etc. working
fine

any clue what could happen here?

thanks
josef

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: post - all empty?
country flaguser name
United States
2007-09-07 09:44:42
Josef Chladek wrote:
> hi list,
> 
> I have a strange problem, that occurs for some clients,
for most not: we
> have a form, that is setup  by javascript dynamically
(form consits of
> one input field, one textarea and 2 hidden fields)
> 
> ...
>
form.setAttribute('action','/cat/postings/post_comment');
> form.setAttribute('id','input_form');
> form.setAttribute('name','input_form');
> form.setAttribute('method','post');
> form.setAttribute('enctype','multipart/form-data');
> form.setAttribute('accept-charset','utf-8');
> form.setAttribute('onSubmit', 'return check(' + parent
+ ')');
> ...
> 
> as said, most of the time it works without a problem,
but sometimes I
> get the following error:
> 
> [error] Caught exception in engine "Wrong
Content-Length value: xxx at
> /usr/local/share/perl/5.8.8/Catalyst.pm line
1636"
> 
> which is thrown from Enigne.pm
> 
> # paranoia against wrong Content-Length header
> my $remaining = $length - $self->read_position;
> if ( $remaining > 0 ) {
>     $self->finalize_read($c);
>     Catalyst::Exception->throw(
>        "Wrong Content-Length value: $length"
);
> }
> 
> from debugging I found out, that $remaining in fact is
$length, so it
> seems, that nothing was read from the post body
> 
> HTTP::Body is version 0.9, I changed
multipart/form-data to
> application/x-www-form-urlencoded, still no effect.
> to see the form, you have to be logged in, which works
fine, I can
> identify the user from the session, so cookie etc.
working fine
> 
> any clue what could happen here?
> 
> thanks
> josef

If the Content-Length really is 0, I've found one thing over
the years
that does it. Older Mozilla/Netscape versions, usually
CompuServe
branded versions, would not POST and content of a form if
javascript set
the forms style to display:none or hidden in CSS.

In my case, if was the usual tinkerage of hiding the form
and displaying
a "Now processing" image when a user clicked the
Submit button.

To this day, I still get the occasional Content-Length: 0
from these
browsers...about 5 a week.

Just a thought.

-=Chris


_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: post - all empty?
country flaguser name
Austria
2007-09-07 09:58:56
Am 07.09.2007 um 16:44 schrieb Christopher H. Laco:

> Josef Chladek wrote:
>> hi list,
>>
>> I have a strange problem, that occurs for some
clients, for most  
>> not: we
>> have a form, that is setup  by javascript
dynamically (form  
>> consits of
>> one input field, one textarea and 2 hidden fields)
>>
>> ...
>>
form.setAttribute('action','/cat/postings/post_comment');
>> form.setAttribute('id','input_form');
>> form.setAttribute('name','input_form');
>> form.setAttribute('method','post');
>>
form.setAttribute('enctype','multipart/form-data');
>> form.setAttribute('accept-charset','utf-8');
>> form.setAttribute('onSubmit', 'return check(' +
parent + ')');
>> ...
>>
>> as said, most of the time it works without a
problem, but sometimes I
>> get the following error:
>>
>> [error] Caught exception in engine "Wrong
Content-Length value:  
>> xxx at
>> /usr/local/share/perl/5.8.8/Catalyst.pm line
1636"
>>
>> which is thrown from Enigne.pm
>>
>> # paranoia against wrong Content-Length header
>> my $remaining = $length - $self->read_position;
>> if ( $remaining > 0 ) {
>>     $self->finalize_read($c);
>>     Catalyst::Exception->throw(
>>        "Wrong Content-Length value:
$length" );
>> }
>>
>> from debugging I found out, that $remaining in fact
is $length, so it
>> seems, that nothing was read from the post body
>>
>> HTTP::Body is version 0.9, I changed
multipart/form-data to
>> application/x-www-form-urlencoded, still no
effect.
>> to see the form, you have to be logged in, which
works fine, I can
>> identify the user from the session, so cookie etc.
working fine
>>
>> any clue what could happen here?
>>
>> thanks
>> josef
>
> If the Content-Length really is 0, I've found one thing
over the years
> that does it. Older Mozilla/Netscape versions, usually
CompuServe
> branded versions, would not POST and content of a form
if  
> javascript set
> the forms style to display:none or hidden in CSS.
>
> In my case, if was the usual tinkerage of hiding the
form and  
> displaying
> a "Now processing" image when a user clicked
the Submit button.
>
> To this day, I still get the occasional Content-Length:
0 from these
> browsers...about 5 a week.
>
> Just a thought.

hmm, I dumped req->headers and this happens for IE7, IE6
and FF2.x,  
so not the oldest browsers.
I temp. switched to method get now, think that will work.
any hints on how I could get closer to the problem, where
should I  
put debug code, somewhere in Engine.pm or Catalyst.pm?

thanks
josef

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: post - all empty?
user name
2007-09-07 14:24:30
On Fri, Sep 07, 2007 at 04:26:56PM +0200, Josef Chladek
wrote:
> from debugging I found out, that $remaining in fact is
$length, so it  
> seems, that nothing was read from the post body

Are you using SSL? This is way old and doesn't seem to fit
your case,
but some old versions of IE post with zero content length.

    http://support.microsoft.com/default.aspx?kbid=831167

It's amazing that I still see this every so often.

-- 
Bill Moseley
moseleyhank.org


_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: post - all empty?
country flaguser name
Sweden
2007-09-07 14:48:20
Am 07.09.2007 um 21:24 schrieb Bill Moseley:

> On Fri, Sep 07, 2007 at 04:26:56PM +0200, Josef Chladek
wrote:
>> from debugging I found out, that $remaining in fact
is $length, so it
>> seems, that nothing was read from the post body
>
> Are you using SSL? This is way old and doesn't seem to
fit your case,
> but some old versions of IE post with zero content
length.
>
>     http://support.microsoft.com/default.aspx?kbid=831167
>
> It's amazing that I still see this every so often.

nope, plain http, no ssl involved. and it happens for
firefox as well.

I could throw/show an error page, but I can't even display
the user- 
input on that page (because there is none), which is a pity,
because  
it's a message-board, so the message is gone after
submit...
method get is not perfect (long postings will be cut off).

thanks
josef

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: post - all empty?
country flaguser name
Austria
2007-09-10 10:55:02
Am 07.09.2007 um 21:48 schrieb Josef Chladek:

> Am 07.09.2007 um 21:24 schrieb Bill Moseley:
>
>> On Fri, Sep 07, 2007 at 04:26:56PM +0200, Josef
Chladek wrote:
>>> from debugging I found out, that $remaining in
fact is $length,  
>>> so it
>>> seems, that nothing was read from the post
body
>>
>> Are you using SSL? This is way old and doesn't seem
to fit your case,
>> but some old versions of IE post with zero content
length.
>>
>>     http://support.microsoft.com/default.aspx?kbid=831167
>>
>> It's amazing that I still see this every so often.
>
> nope, plain http, no ssl involved. and it happens for
firefox as well.
>
> I could throw/show an error page, but I can't even
display the user- 
> input on that page (because there is none), which is a
pity,  
> because it's a message-board, so the message is gone
after submit...
> method get is not perfect (long postings will be cut
off).

if someone is interested:
I switched to fastcgi (instead of mod_perl) and the problem
ist gone...

josef

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )