Hi RĂ¼diger, I understand the request is not correct, but httpd answers anyway (at least the version installed on my pc):
To the previous request, my httpd answers as following: |<-- from here -->| HTTP/1.1 404 Not Found Date: Thu, 26 Mar 2009 07:09:17 GMT Server: Apache/2.2.11 (Win32) PHP/5.2.9 Content-Length: 206 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /endpoint was not found on this server.</p> </body></html> HTTP/1.1 400 Bad Request Date: Thu, 26 Mar 2009 07:09:17 GMT Server: Apache/2.2.11 (Win32) PHP/5.2.9 Content-Length: 226 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> </p> </body></html> |<-- to here -->| As you can see, httpd detects the second request, even if it answers with 400 Bad Request. Thanks Andrea ----- Original Message ---- From: Ruediger Pluem <[email protected]> To: [email protected] Sent: Thursday, March 26, 2009 7:57:47 AM Subject: Re: HTTP pipelining in keep-alive requests On 26.03.2009 07:32, Andrea Martino wrote: > Hi all, > > For a small project I'm working on (a Java-UPNP server) I'm trying to > replicate some Apache functions, and there is one I can't figure out on my > own (I looked at the code but I didn't understand how it works). > > Let's assume the httpd receives the following pipelined requests (WITHOUT > content-lenght header): > > |<-- from here -->| > POST /endpoint HTTP/1.1 > User-Agent: Xenon > Connection: Keep-alive > Host:192.168.1.40 > > <soap>bla bla bla</soap>GET /description HTTP/1.1 > User-Agent: Xenon > Connection: Keep-alive > Host:192.168.1.40 > > |<-- to here -->| > > I noticed that somehow the webserver is able to detect the second request, > even if theoretically the second get could be part of the first put, how does > it work? How does apache figure out when the first PUT is complete? Does > apache > consider new lines, new packets, or delays? Or does it only consider the socket content? It does not. Your request is invalid. Either you need to provide a content-length header for the length of your your request body or you need to send it in chunked encoding. Regards RĂ¼diger
