version 1.8, 2000/07/06 06:24:50 |
version 1.9, 2000/07/07 15:34:02 |
|
|
|
|
/* and now the big ol' select shoveling loop ... */ |
/* and now the big ol' select shoveling loop ... */ |
while (FD_ISSET(fd, &fds1)) { /* i.e. till the *net* closes! */ |
while (FD_ISSET(fd, &fds1)) { /* i.e. till the *net* closes! */ |
|
struct timeval *tv; |
|
|
wretry = 8200; /* more than we'll ever hafta write */ |
wretry = 8200; /* more than we'll ever hafta write */ |
if (wfirst) { /* any saved stdin buffer? */ |
if (wfirst) { /* any saved stdin buffer? */ |
wfirst = 0; /* clear flag for the duration */ |
wfirst = 0; /* clear flag for the duration */ |
goto shovel; /* and go handle it first */ |
goto shovel; /* and go handle it first */ |
} |
} |
fds2 = fds1; |
fds2 = fds1; |
memcpy(&timer2, &timer1, sizeof(struct timeval)); |
if (timer1.tv_sec > 0 || timer1.tv_usec > 0) { |
rr = select(getdtablesize(), &fds2, 0, 0, &timer2); |
memcpy(&timer2, &timer1, sizeof(struct timeval)); |
|
tv = &timer2; |
|
} else |
|
tv = NULL; |
|
rr = select(getdtablesize(), &fds2, 0, 0, tv); |
if (rr < 0) { |
if (rr < 0) { |
if (errno != EINTR) { /* might have gotten ^Zed, etc |
if (errno != EINTR) { /* might have gotten ^Zed, etc |
* ? */ |
* ? */ |