Re: Receiving requests

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

Received on Sunday, 24 March 1996 16:26:58 UTC