Browse Subversion Repository
Diff of /trunk/sub.c
Parent Directory
| Revision Log
| Patch
| 319 |
*/ |
*/ |
| 320 |
timeout.tv_sec = ftp->timeout_sec; |
timeout.tv_sec = ftp->timeout_sec; |
| 321 |
timeout.tv_usec = 0; |
timeout.tv_usec = 0; |
|
FD_ZERO( &rfds ); |
|
|
FD_ZERO( &wfds ); |
|
|
FD_SET( sock, &rfds ); |
|
|
FD_SET( sock, &wfds ); |
|
| 322 |
|
|
| 323 |
res = select( sock+1, &rfds, &wfds, 0, &timeout ); |
do { |
| 324 |
if( res == 0 ) { /* timeout */ |
FD_ZERO( &rfds ); |
| 325 |
DEBUGPRINT1( "getready_active: waiting connection timeout.%s\n", "" ); |
FD_ZERO( &wfds ); |
| 326 |
close( sock ); |
FD_SET( sock, &rfds ); |
| 327 |
return -3; |
FD_SET( sock, &wfds ); |
| 328 |
} |
|
| 329 |
|
res = select( sock+1, &rfds, &wfds, 0, &timeout ); |
| 330 |
|
if( res == 0 ) { /* timeout */ |
| 331 |
|
DEBUGPRINT1( "getready_active: waiting connection timeout.%s\n", "" ); |
| 332 |
|
close( sock ); |
| 333 |
|
return -3; |
| 334 |
|
} |
| 335 |
|
if( res < 0 ) { |
| 336 |
|
if( errno == EINTR ) continue; |
| 337 |
|
DEBUGPRINT1( "getready_active: select error. %s\n", strerror(errno) ); |
| 338 |
|
close( sock ); |
| 339 |
|
return -3; |
| 340 |
|
} |
| 341 |
|
|
| 342 |
|
if( FD_ISSET( sock, &rfds ) || FD_ISSET( sock, &wfds ) ) break; |
| 343 |
|
} while( 1 ); |
| 344 |
|
|
| 345 |
res = accept( sock, (struct sockaddr *)&saddr, &saddr_len ); |
res = accept( sock, (struct sockaddr *)&saddr, &saddr_len ); |
| 346 |
close( sock ); |
close( sock ); |
| 347 |
if( res < 0 ) { |
if( res < 0 ) { |
|
|
Legend:
| Removed from v.26 |
|
| changed lines |
| |
Added in v.28 |
|
|
| |