/[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.23 by sysadm, Mon May 5 11:59:18 2025 UTC Revision 1.24 by sysadm, Mon May 5 14:27:57 2025 UTC
# Line 42  struct _bbsnet_conf Line 42  struct _bbsnet_conf
42          char host1[20];          char host1[20];
43          char host2[40];          char host2[40];
44          char ip[40];          char ip[40];
45          int port;          in_port_t port;
46  } bbsnet_conf[MAXSTATION];  } bbsnet_conf[MAXSTATION];
47    
48  MENU_SET bbsnet_menu;  MENU_SET bbsnet_menu;
# Line 85  int load_bbsnet_conf(const char *file_co Line 85  int load_bbsnet_conf(const char *file_co
85                  bbsnet_conf[item_count].host2[sizeof(bbsnet_conf[item_count].host2) - 1] = '\0';                  bbsnet_conf[item_count].host2[sizeof(bbsnet_conf[item_count].host2) - 1] = '\0';
86                  strncpy(bbsnet_conf[item_count].ip, t3, sizeof(bbsnet_conf[item_count].ip) - 1);                  strncpy(bbsnet_conf[item_count].ip, t3, sizeof(bbsnet_conf[item_count].ip) - 1);
87                  bbsnet_conf[item_count].ip[sizeof(bbsnet_conf[item_count].ip) - 1] = '\0';                  bbsnet_conf[item_count].ip[sizeof(bbsnet_conf[item_count].ip) - 1] = '\0';
88                  bbsnet_conf[item_count].port = t4 ? atoi(t4) : 23;                  bbsnet_conf[item_count].port = (in_port_t)(t4 ? atoi(t4) : 23);
89    
90                  p_menuitem = p_menu->items[item_count] = malloc(sizeof(MENU_ITEM));                  p_menuitem = p_menu->items[item_count] = malloc(sizeof(MENU_ITEM));
91                  p_menuitem->row = 2 + item_count / STATION_PER_LINE;                  p_menuitem->row = 2 + item_count / STATION_PER_LINE;
# Line 96  int load_bbsnet_conf(const char *file_co Line 96  int load_bbsnet_conf(const char *file_co
96                  p_menuitem->level = 0;                  p_menuitem->level = 0;
97                  p_menuitem->display = 0;                  p_menuitem->display = 0;
98                  p_menuitem->name[0] =                  p_menuitem->name[0] =
99                          (item_count < MAXSTATION / 2 ? 'A' + item_count : 'a' + item_count);                          (char)(item_count < MAXSTATION / 2 ? 'A' + item_count : 'a' + item_count);
100                  p_menuitem->name[1] = '\0';                  p_menuitem->name[1] = '\0';
101                  snprintf(p_menuitem->text, sizeof(p_menuitem->text), "%c. %s",                  snprintf(p_menuitem->text, sizeof(p_menuitem->text), "%c. %s",
102                                   p_menuitem->name[0], bbsnet_conf[item_count].host1);                                   p_menuitem->name[0], bbsnet_conf[item_count].host1);
# Line 146  static void process_bar(int n, int len) Line 146  static void process_bar(int n, int len)
146    
147  int bbsnet_connect(int n)  int bbsnet_connect(int n)
148  {  {
149          int sock, result, len, loop;          int sock, result, loop;
150            ssize_t len;
151          struct sockaddr_in sin;          struct sockaddr_in sin;
152          char buf[256];          char buf[256];
153          fd_set inputs, testfds;          fd_set inputs, testfds;
# Line 283  int bbsnet_connect(int n) Line 284  int bbsnet_connect(int n)
284                                  {                                  {
285                                          loop = 0;                                          loop = 0;
286                                  }                                  }
287                                  write(sock, buf, len);                                  write(sock, buf, (size_t)len);
288                          }                          }
289                          if (FD_ISSET(sock, &testfds))                          if (FD_ISSET(sock, &testfds))
290                          {                          {
# Line 292  int bbsnet_connect(int n) Line 293  int bbsnet_connect(int n)
293                                  {                                  {
294                                          loop = 0;                                          loop = 0;
295                                  }                                  }
296                                  write(1, buf, len);                                  write(1, buf, (size_t)len);
297                          }                          }
298                          BBS_last_access_tm = time(0);                          BBS_last_access_tm = time(0);
299                  }                  }


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

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