Apache

Moderators: None (Apply to moderate this forum)
Number of threads: 150
Number of posts: 335

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
HTTP protocol, request termination Posted by Josh Code on 30 Mar 2007 at 8:29 AM
I'm trying to make a simple HTTP server and running into problems with receiving HTTP POST requests.

The problem is that I don't know how to determine when to stop reading a POST request. Some requests don't specify Content-Length and the socket's input stream stays open after the whole message should have been read in.

Here is an example POST request:
POST / HTTP/1.0
Host: socr.uwindsor.ca:3456

var1=bla+bla&var2=yo


If you look at the body of that request, you can quickly see the problem. When reading that in, how do I know there isn't another variable specified in the body that I should keep waiting for?







 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.