version 1.9 | | version 1.10 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_loop_c = | | * static char *rcsid_loop_c = |
* "$Id: loop.c,v 1.9 2001/03/30 07:52:24 mwedel Exp $"; | | * "$Id: loop.c,v 1.10 2001/04/06 00:43:26 michtoen Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#ifndef __CEXTRACT__ | | #ifndef __CEXTRACT__ |
#include <sproto.h> | | #include <sproto.h> |
#include <sockproto.h> | | #include <sockproto.h> |
| | |
#endif | | #endif |
| | |
| | #ifndef WIN32 // ---win32 exclude unix headers |
#include <sys/types.h> | | #include <sys/types.h> |
#include <sys/time.h> | | #include <sys/time.h> |
#include <sys/socket.h> | | #include <sys/socket.h> |
#include <netinet/in.h> | | #include <netinet/in.h> |
#include <netdb.h> | | #include <netdb.h> |
| | #endif // end win32 |
| | |
#ifdef HAVE_UNISTD_H | | #ifdef HAVE_UNISTD_H |
#include <unistd.h> | | #include <unistd.h> |
| | |
* or no more characters to read. | | * or no more characters to read. |
*/ | | */ |
do { | | do { |
| | #ifdef WIN32 // ***win32: change oldsocket read() to recv() |
| | stat = recv(ns->fd, ns->inbuf.buf + ns->inbuf.len, 1,0); |
| | |
| | if (stat==-1 && WSAGetLastError() !=WSAEWOULDBLOCK) { |
| | #else |
do { | | do { |
stat = read(ns->fd, ns->inbuf.buf + ns->inbuf.len, 1); | | stat = read(ns->fd, ns->inbuf.buf + ns->inbuf.len, 1); |
} while ((stat<0) && (errno == EINTR)); | | } while ((stat<0) && (errno == EINTR)); |
| | |
if (stat<0 && errno != EAGAIN && errno !=EWOULDBLOCK) { | | if (stat<0 && errno != EAGAIN && errno !=EWOULDBLOCK) { |
| | #endif |
perror("Handle_Oldsocket got an error."); | | perror("Handle_Oldsocket got an error."); |
ns->status = Ns_Dead; | | ns->status = Ns_Dead; |
return; | | return; |