W3C home > Mailing lists > Public > www-talk@w3.org > July to August 1996

Re: POST forms & Netscape Navigator

From: Matthew Denner <matt@wdi.co.uk>
Date: Thu, 25 Jul 1996 12:10:01 +0100
Message-ID: <31F75609.D91@wdi.co.uk>
To: Paul Hethmon <phethmon@utk.edu>
CC: www-talk@w3.org
Paul Hethmon wrote:
> 
> ** Reply to note from Soren Vejrum <sve@europa.dannet.dk> Thu, 25 Jul 1996 11:22:35 +0200
> >
> > Matthew Denner wrote:
> > >
> > > All,
> > >
> > > I've been working on a HTTPd for about 6 months now and when I started
> > > Netscape Navigator 1.0 worked fine with POST forms.  Now I find that
> > > my POST forms don't work with Navigators 2.0 and above.  I understand
> > > that I get a POST response from the client and I can retrieve the
> > > header information but where does the actual data come from?
> > >
> > > With Navigator 1.0 the data was sent along with the header separated
> > > by at least 2 CRLF's.  Now I just get the header and the server sits
> > > in an infinite loop waiting for the data.  Have Netscape altered the
> > > way their browser works?  Does the data get sent on a different port?
> > > Or does the server have to send a response to the header so that the
> > > data can be sent by the client?
> >
> > Your problem is probably that your server reads data until the
> > connection is closed/blocked by the client as a sign that the full
> > request has been sent. However in never versions of Netscape they have
> > implemented the "Keep-Alive" header for multiple requests over a single
> > tcp/ip connection.
> >
> > 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.

> 
> What you should do is read the standard. RFC 1945 has been issued as
> an informational standard for HTTP/1.0 and HTTP/1.1 is in draft standard
> right now. You can get the latest draft standard for 1.1 from
> www.w3.org. Follow the links to the HTTP stuff.
> 

I have read the specification and have implemented an HTTP/1.1 server.

> You do have to read and parse the Content-Length to determine how much data
> 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.

> 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.

Matt
-- 
-----------------------------------------------------------------------
Matthew Denner  			email:	matt@wdi.co.uk
Senior Programmer			tel:	(+44)(0) 1305 871 543
Abbotsbury Software Ltd			fax:	(+44)(0) 1305 871 688
ENGLAND					mobile:	(+44)(0) 385  795 492
-----------------------------------------------------------------------
Received on Thursday, 25 July 1996 08:12:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 October 2010 18:14:19 GMT