Re: Temporary build

Colin Leroy <[email protected]>
Newsgroups gmane.network.everybuddy.user
Message-ID <[email protected]>
On 10 Apr 2003 at 09h03, Colin Leroy wrote:

Hi,

> > (A) Unless the socket is set to non-blocking, the only time that
> > read() will return less than the desired number of bytes is on EOF
> > (when the stream is closed).
> 
> Heh, sorry, i overlooked ext_connect_socket yesterday and read async
> instead of sync :-)

i really should wake up before replying to mails :)

from man 2 read again:
      "It is not an  error  if  this  number  is
       smaller  than the number of bytes requested; this may hap­
       pen for example because fewer bytes are actually available
       right  now "

0 is returned in case of EOF and -1 if there's an error.

from my patch:
+         if (errno == EAGAIN || i < remaining) {
+                 sleep(1);
+                 tries++;
+         }

what you don't need here is the errno==EAGAIN check as your sockets are
blocking. 
-- 
Colin -
"GPL software is like this thing called Linux, where 
 you can never commercialize anything around it" - Bill Gates
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.