ソースを参照

* Close and delete the unix domain socket if a localhub loses its localhub status

Bryan Drewery 16 年 前
コミット
05e3490a75
1 ファイル変更14 行追加1 行削除
  1. 14 1
      src/binary.c

+ 14 - 1
src/binary.c

@@ -17,6 +17,7 @@
 #include "misc_file.h"
 #include "tandem.h"
 #include "botnet.h"
+#include "net.h"
 #include "userrec.h"
 
 #include <sys/wait.h>
@@ -755,8 +756,20 @@ void reload_bin_data() {
     if (oldbots)
       free_conf_bots(oldbots);
 
-    if (!conf.bot->localhub)
+    if (!conf.bot->localhub) {
       free_conf_bots(conf.bots);
+
+      if (was_localhub) {
+        //Close the listening port
+        for (int i = 0; i < dcc_total; i++) {
+          if (dcc[i].type && (dcc[i].type == &DCC_TELNET) && (strchr(dcc[i].host, '/'))) {
+              unlink(dcc[i].host);
+              killsock(dcc[i].sock);
+              lostdcc(i);
+          }
+        }
+      }
+    }
   }
 }