/[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.90 by sysadm, Tue Dec 16 15:20:56 2025 UTC Revision 1.92 by sysadm, Wed Dec 17 03:56:39 2025 UTC
# Line 802  static int bbsnet_connect(int n) Line 802  static int bbsnet_connect(int n)
802          {          {
803                  if (SSH_v2 && ssh_channel_is_closed(SSH_channel))                  if (SSH_v2 && ssh_channel_is_closed(SSH_channel))
804                  {                  {
805    #ifdef _DEBUG
806                          log_error("SSH channel is closed\n");                          log_error("SSH channel is closed\n");
807    #endif
808                          loop = 0;                          loop = 0;
809                          break;                          break;
810                  }                  }
811    
812                  if (bbsnet_conf[n].use_ssh && ssh_channel_is_closed(channel))                  if (bbsnet_conf[n].use_ssh && ssh_channel_is_closed(channel))
813                  {                  {
814    #ifdef _DEBUG
815                          log_error("Remote SSH channel is closed\n");                          log_error("Remote SSH channel is closed\n");
816    #endif
817                          loop = 0;                          loop = 0;
818                          break;                          break;
819                  }                  }
# Line 904  static int bbsnet_connect(int n) Line 908  static int bbsnet_connect(int n)
908                                          ret = ssh_channel_read_nonblocking(SSH_channel, input_buf + input_buf_len, sizeof(input_buf) - (uint32_t)input_buf_len, 0);                                          ret = ssh_channel_read_nonblocking(SSH_channel, input_buf + input_buf_len, sizeof(input_buf) - (uint32_t)input_buf_len, 0);
909                                          if (ret == SSH_ERROR)                                          if (ret == SSH_ERROR)
910                                          {                                          {
911    #ifdef _DEBUG
912                                                  log_error("ssh_channel_read_nonblocking() error: %s\n", ssh_get_error(SSH_session));                                                  log_error("ssh_channel_read_nonblocking() error: %s\n", ssh_get_error(SSH_session));
913    #endif
914                                                  loop = 0;                                                  loop = 0;
915                                                  break;                                                  break;
916                                          }                                          }
# Line 1007  static int bbsnet_connect(int n) Line 1013  static int bbsnet_connect(int n)
1013                                          ret = ssh_channel_write(channel, input_conv + input_conv_offset, (uint32_t)(input_conv_len - input_conv_offset));                                          ret = ssh_channel_write(channel, input_conv + input_conv_offset, (uint32_t)(input_conv_len - input_conv_offset));
1014                                          if (ret == SSH_ERROR)                                          if (ret == SSH_ERROR)
1015                                          {                                          {
1016    #ifdef _DEBUG
1017                                                  log_error("ssh_channel_write() error: %s\n", ssh_get_error(session));                                                  log_error("ssh_channel_write() error: %s\n", ssh_get_error(session));
1018    #endif
1019                                                  loop = 0;                                                  loop = 0;
1020                                                  break;                                                  break;
1021                                          }                                          }
# Line 1029  static int bbsnet_connect(int n) Line 1037  static int bbsnet_connect(int n)
1037                                          }                                          }
1038                                          else                                          else
1039                                          {                                          {
1040    #ifdef _DEBUG
1041                                                  log_error("write(socket) error (%d)\n", errno);                                                  log_error("write(socket) error (%d)\n", errno);
1042    #endif
1043                                                  loop = 0;                                                  loop = 0;
1044                                                  break;                                                  break;
1045                                          }                                          }
# Line 1067  static int bbsnet_connect(int n) Line 1077  static int bbsnet_connect(int n)
1077                                                                                                             (uint32_t)(sizeof(output_buf) - (size_t)output_buf_len), 0);                                                                                                             (uint32_t)(sizeof(output_buf) - (size_t)output_buf_len), 0);
1078                                          if (ret == SSH_ERROR)                                          if (ret == SSH_ERROR)
1079                                          {                                          {
1080    #ifdef _DEBUG
1081                                                  log_error("ssh_channel_read_nonblocking() error: %s\n", ssh_get_error(session));                                                  log_error("ssh_channel_read_nonblocking() error: %s\n", ssh_get_error(session));
1082    #endif
1083                                                  loop = 0;                                                  loop = 0;
1084                                                  break;                                                  break;
1085                                          }                                          }
# Line 1100  static int bbsnet_connect(int n) Line 1112  static int bbsnet_connect(int n)
1112                                          }                                          }
1113                                          else                                          else
1114                                          {                                          {
1115    #ifdef _DEBUG
1116                                                  log_error("read(socket) error (%d)\n", errno);                                                  log_error("read(socket) error (%d)\n", errno);
1117    #endif
1118                                                  loop = 0;                                                  loop = 0;
1119                                                  break;                                                  break;
1120                                          }                                          }
# Line 1141  static int bbsnet_connect(int n) Line 1155  static int bbsnet_connect(int n)
1155                                          ret = ssh_channel_write(SSH_channel, output_conv + output_conv_offset, (uint32_t)(output_conv_len - output_conv_offset));                                          ret = ssh_channel_write(SSH_channel, output_conv + output_conv_offset, (uint32_t)(output_conv_len - output_conv_offset));
1156                                          if (ret == SSH_ERROR)                                          if (ret == SSH_ERROR)
1157                                          {                                          {
1158    #ifdef _DEBUG
1159                                                  log_error("ssh_channel_write() error: %s\n", ssh_get_error(SSH_session));                                                  log_error("ssh_channel_write() error: %s\n", ssh_get_error(SSH_session));
1160    #endif
1161                                                  loop = 0;                                                  loop = 0;
1162                                                  break;                                                  break;
1163                                          }                                          }
# Line 1163  static int bbsnet_connect(int n) Line 1179  static int bbsnet_connect(int n)
1179                                          }                                          }
1180                                          else                                          else
1181                                          {                                          {
1182    #ifdef _DEBUG
1183                                                  log_error("write(STDOUT) error (%d)\n", errno);                                                  log_error("write(STDOUT) error (%d)\n", errno);
1184    #endif
1185                                                  loop = 0;                                                  loop = 0;
1186                                                  break;                                                  break;
1187                                          }                                          }
# Line 1325  int bbs_net() Line 1343  int bbs_net()
1343                  switch (ch)                  switch (ch)
1344                  {                  {
1345                  case KEY_NULL: // broken pipe                  case KEY_NULL: // broken pipe
1346    #ifdef _DEBUG
1347                          log_error("KEY_NULL\n");                          log_error("KEY_NULL\n");
1348    #endif
1349                          goto cleanup;                          goto cleanup;
1350                  case KEY_TIMEOUT:                  case KEY_TIMEOUT:
1351                          if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time)                          if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time)


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

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