Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > The incorrect content length problem with Apache, how to stop waiting for data, and send a reply in CGI?

Reply
Thread Tools

The incorrect content length problem with Apache, how to stop waiting for data, and send a reply in CGI?

 
 
samkipers445r@yahoo.com
Guest
Posts: n/a
 
      09-22-2005
Hello

Maybe someone who knows apache internals can help on this issue.

We created an http client application, and a server CGI script on perl
to exchange data between the application which is spread among many
users and our server. Unfortunately the client application had a bug
with https POST method when it sent less data than specified in content
length header. It happens on a certain combination of input data
entered by end user. As the result the Apache server waits for the
missing data because of incorrect content length sent by the client,
and we never have a chance to send a reply back to the client
application. The client application simply closes the connection after
one minute timeout period.

Is there any way to force Apache to cancel the wait on receiving
missing data in Post method and switch it to sending data to reply back
to the client application from CGI script?

We tried writing to stdout and/or closing stdin, but it doesn't help,
it seems Apache keeps on hanging, and doesn't want to send anything
while waiting for missing data because of incorrect content length.

Thanks,
Sam Kipers

 
Reply With Quote
 
 
 
 
Juha Laiho
Guest
Posts: n/a
 
      09-25-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) said:
>We created an http client application, and a server CGI script on perl
>to exchange data between the application which is spread among many
>users and our server. Unfortunately the client application had a bug
>with https POST method when it sent less data than specified in content
>length header.


Well, wouldn't it be better to fix the client application (as you said,
you created it, so you should still be able to change it), than to leave
the client buggy and create a separate workaround?

>Is there any way to force Apache to cancel the wait on receiving
>missing data in Post method and switch it to sending data to reply back
>to the client application from CGI script?


This might be possible with a nph-script (no-parse-headers), which
pretty much will make apache into a raw data pipe - instead of its
normal mode of operation, where it makes at least some sanity checks
to the data - in order to partially protect the server application.
So, with a nph-script, the server-side script has the full responsibility
to handle anything that might come down the pipe (ok, it is required
that the start of request is correct enough HTTP that Apache knows
to fire the script, but after that, all is up to your script. Still,
fixing the client end would be much better.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
Reply With Quote
 
 
 
 
samkipers445r@yahoo.com
Guest
Posts: n/a
 
      09-26-2005
Hello Juha,

thanks for the reply.

The bug in the client has been fixed already. We cannot update the
client among our clients quickly. Usually it takes 2-3 months. Thus the
problem still persists. The server is overloaded with idle script
processes.

we have renamed the script to nph-xxx.pl and the problem still
persists. yes, in case of nph scripts, we should send all headers back
to client, for example "HTTP/1.0 302 Moved\r\n" and apache passes it to
the client without modification, but it doesn't fix the problem. apache
still waits for missing data, and it seems that it parses the content
length header in the query anyway.

Is there a way to fix the problem programmatically with CGI? Somehow we
need to tell Apache to stop waiting for data and send a required reply
to the client.

I feel that customizing/patching Apache for this particular problem is
not a good decision.

Any suggestions?

Thanks,
Sam Kipers

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
how to reply to posts on google groups (and not reply to just author) davidj411 Python 1 05-27-2008 04:13 PM
WEBSITE FOUND.WAITING FOR REPLY MESSAGE BLINKS IN THE STATUS BAR =?Utf-8?B?SGlyYWs=?= ASP .Net 0 05-26-2006 01:08 PM
can sombody tell me how to reply to sombody elses message and include the original message in the reply? Computer Support 3 08-24-2003 12:58 PM
Re: can sombody tell me how to reply to sombody elses message and include the original message in the reply? Computer Support 0 07-24-2003 09:21 PM



Advertisments