- From: Paul Hethmon <phethmon@utk.edu>
- Date: Thu, 25 Jul 1996 08:34:06 EST
- To: matt@wdi.co.uk, www-talk@w3.org
Addressed to: matt@wdi.co.uk www-talk@w3.org ** Reply to note from Matthew Denner <matt@wdi.co.uk> Thu, 25 Jul 1996 12:10:01 +0100 > > > Instead of reading until the end of the connection you should find the > > > "Content-Length" header which tells you the size of the POST'ed data. > > > Read this number of bytes after the 2 CRLF's. > > I do read the Content-Length header and I do wait for the correct number > of > bytes to come through. However, the connection has no data present for > collection and the machine simply sits there waiting. Have you tried using select on the socket to implement a timeout at least? > > to read. Doing the keep-alive is optional if you're doing a HTTP/1.0 > > server. It's not part of the "standard" part of RFC 1945. It is the default > > for HTTP/1.1 which means as a server you must always send a valid Content-Length > > when sending an entity body to the client. > > > > The keep-alive header isn't implemented properly in Netscape as far as I > can > tell. The connection is continually closed by Navigator after just one > request. > But I'm not sure on this as it could be my programming. Don't know about this one. My HTTP/1.0 server doesn't do persistent at all. > > A technical point here also (probably minor and fussy), but the way you > > view the separation between headers and entity body is there is only > > one empty line (CRLF). The first CRLF is attached as the end marker for the > > last header. The separation is then marked by an emtpy line. Whatever comes > > after that is the entity body. > > > > There are two CRLF's: the last line of the header, and the empty line. > Besides > which I have altered the code to check for an empty line. What I'm saying is the CRLF after a header is considered part of the header, not part of the next line. Something like: POST /cgi-bin/test HTTP/1.0CRLF Content-Type: text/plainCRLF Content-Length: 50CRLF CRLF post data starts ... At least from my perspective, the CRLF is logically part of the header line it is on. What ends the headers is a line without data, just CRLF. I guess later today, I'll have to do some testing with Netscape. I've just used my own testing program to date since I don't think Netscape implements any 1.1 stuff yet. It's also a heck of a lot easier to simulate when I can control the input exactly. Paul Paul Hethmon phethmon@utk.edu ---------------------------------------------------------- Computerman -- Agricultural Policy Analysis Center ---------------------------------------------------------- NeoLogic Ftp & Mail Servers ---------------------------------------------------------- Knoxville Warp User's: http://apacweb.ag.utk.edu/os2 ----------------------------------------------------------
Received on Thursday, 25 July 1996 08:33:15 UTC