[9871] in www-talk@info.cern.ch
Re: Receiving requests
daemon@ATHENA.MIT.EDU (Simon Spero)
Sun Mar 24 16:56:17 1996
Date: Sun, 24 Mar 1996 13:30:16 -0800 (PST)
From: Simon Spero <ses@tipper.oit.unc.edu>
To: Fabien Petitcolas <fapp2@hermes.cam.ac.uk>
Cc: "'www-talk@w3.org'" <www-talk@w3.org>
In-Reply-To: <01BB19BB.CEF28680@lugdunum.wolfson.cam.ac.uk>
Resent-From: www-talk@w3.org
On Sun, 24 Mar 1996, Fabien Petitcolas wrote:
> What is the most common way for receiving requests from a browser?
> I tried to use the following code, but the program stops in the loop.
> What's wrong in this way of doing?
>
>
> while ((nread = recv(socket, buffer, BUFFER_SIZE, 0))>0)
Typical Fenland community college student :-)
The reason your code doesn't work is that you're trying to read
everything up until the end of file, when you really only want to read
until the end of the first line.
Simon
---
They say in online country So which side are you on boys
There is no middle way Which side are you on
You'll either be a Usenet man Which side are you on boys
Or a thug for the CDA Which side are you on?
National Union of Computer Operatives; Hackers, local 37 APL-CPIO