ソースを参照

* Ported [2454] to 1.2.9

svn: 2602
Bryan Drewery 20 年 前
コミット
904cdc9a1e
2 ファイル変更7 行追加3 行削除
  1. 1 0
      doc/UPDATES
  2. 6 3
      src/botnet.c

+ 1 - 0
doc/UPDATES

@@ -29,6 +29,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed bots giving up on joining juped channels (may be due to split) (#168)
 * Fixed cmdpass list getting desynced during userfile transfer. (#143)
 * Removed old compatability code for converting CONFIG->SET during userfile loading.
+* Fixed "un-allocated socket" errors when a relay fails.
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 6 - 3
src/botnet.c

@@ -1080,7 +1080,8 @@ static void failed_tandem_relay(int idx)
   }
   if (uidx < 0) {
     putlog(LOG_MISC, "*", "Can't find user for relay!  %d -> %d", dcc[idx].sock, dcc[idx].u.relay->sock);
-    killsock(dcc[idx].sock);
+    if (dcc[idx].sock != -1)
+      killsock(dcc[idx].sock);
     lostdcc(idx);
     return;
   }
@@ -1092,11 +1093,13 @@ static void failed_tandem_relay(int idx)
     free(dcc[uidx].u.relay);
     dcc[uidx].u.chat = ci;
     dcc[uidx].type = &DCC_CHAT;
-    killsock(dcc[idx].sock);
+    if (dcc[idx].sock != -1)
+      killsock(dcc[idx].sock);
     lostdcc(idx);
     return;
   }
-  killsock(dcc[idx].sock);
+  if (dcc[idx].sock != -1)
+    killsock(dcc[idx].sock);
 #ifdef USE_IPV6
   dcc[idx].sock = getsock(SOCK_STRONGCONN, dcc[uidx].u.relay->af);
 #else