/[LeafOK_CVS]/lbbs/src/bbs_net.c
ViewVC logotype

Diff of /lbbs/src/bbs_net.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.48 by sysadm, Thu Jun 5 08:36:02 2025 UTC Revision 1.51 by sysadm, Tue Jun 17 13:17:04 2025 UTC
# Line 252  int bbsnet_connect(int n) Line 252  int bbsnet_connect(int n)
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);
# Line 406  int bbsnet_connect(int n) Line 406  int bbsnet_connect(int n)
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)
# Line 431  int bbsnet_connect(int n) Line 431  int bbsnet_connect(int n)
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                          }                          }
# Line 498  int bbsnet_connect(int n) Line 498  int bbsnet_connect(int n)
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                                  }                                  }
# Line 666  cleanup: Line 666  cleanup:
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",
# Line 732  int bbs_net() Line 732  int bbs_net()
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();
# Line 749  int bbs_net() Line 749  int bbs_net()
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                          }                          }
# Line 798  int bbs_net() Line 798  int bbs_net()
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:


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1