| 252 |
return -2; |
return -2; |
| 253 |
} |
} |
| 254 |
|
|
| 255 |
bzero(&sin, sizeof(sin)); |
memset(&sin, 0, sizeof(sin)); |
| 256 |
sin.sin_family = AF_INET; |
sin.sin_family = AF_INET; |
| 257 |
sin.sin_addr = *(struct in_addr *)p_host->h_addr_list[0]; |
sin.sin_addr = *(struct in_addr *)p_host->h_addr_list[0]; |
| 258 |
sin.sin_port = htons(bbsnet_conf[n].port); |
sin.sin_port = htons(bbsnet_conf[n].port); |
| 406 |
goto cleanup; |
goto cleanup; |
| 407 |
} |
} |
| 408 |
|
|
| 409 |
BBS_last_access_tm = t_used = time(0); |
BBS_last_access_tm = t_used = time(NULL); |
| 410 |
loop = 1; |
loop = 1; |
| 411 |
|
|
| 412 |
while (loop && !SYS_server_exit) |
while (loop && !SYS_server_exit) |
| 431 |
} |
} |
| 432 |
else if (nfds == 0) // timeout |
else if (nfds == 0) // timeout |
| 433 |
{ |
{ |
| 434 |
if (time(0) - BBS_last_access_tm >= MAX_DELAY_TIME) |
if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME) |
| 435 |
{ |
{ |
| 436 |
break; |
break; |
| 437 |
} |
} |
| 498 |
else |
else |
| 499 |
{ |
{ |
| 500 |
input_buf_len += ret; |
input_buf_len += ret; |
| 501 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(NULL); |
| 502 |
continue; |
continue; |
| 503 |
} |
} |
| 504 |
} |
} |
| 666 |
log_error("Close socket failed\n"); |
log_error("Close socket failed\n"); |
| 667 |
} |
} |
| 668 |
|
|
| 669 |
t_used = time(0) - t_used; |
t_used = time(NULL) - t_used; |
| 670 |
tm_used = gmtime(&t_used); |
tm_used = gmtime(&t_used); |
| 671 |
|
|
| 672 |
log_common("BBSNET disconnect, %d days %d hours %d minutes %d seconds used\n", |
log_common("BBSNET disconnect, %d days %d hours %d minutes %d seconds used\n", |
| 732 |
|
|
| 733 |
load_bbsnet_conf(CONF_BBSNET); |
load_bbsnet_conf(CONF_BBSNET); |
| 734 |
|
|
| 735 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(NULL); |
| 736 |
|
|
| 737 |
clearscr(); |
clearscr(); |
| 738 |
bbsnet_refresh(); |
bbsnet_refresh(); |
| 749 |
case Ctrl('C'): // user cancel |
case Ctrl('C'): // user cancel |
| 750 |
goto cleanup; |
goto cleanup; |
| 751 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 752 |
if (time(0) - BBS_last_access_tm >= MAX_DELAY_TIME) |
if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME) |
| 753 |
{ |
{ |
| 754 |
goto cleanup; |
goto cleanup; |
| 755 |
} |
} |
| 798 |
bbsnet_selchange(); |
bbsnet_selchange(); |
| 799 |
break; |
break; |
| 800 |
} |
} |
| 801 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(NULL); |
| 802 |
} |
} |
| 803 |
|
|
| 804 |
cleanup: |
cleanup: |