瀏覽代碼

lostdcc: Don't unset servidx until after kill().

This is a follow-up to d91543e051. It should be a NOP.  This avoids
possibly using the servidx in the kill() handler.
Bryan Drewery 10 年之前
父節點
當前提交
2ec26f6040
共有 1 個文件被更改,包括 7 次插入8 次删除
  1. 7 8
      src/dccutil.cc

+ 7 - 8
src/dccutil.cc

@@ -590,14 +590,6 @@ lostdcc(int n)
   if (n < 0 || n >= max_dcc)
     return;
 
-  if (n == uplink_idx)
-    uplink_idx = -1;
-  else if (n == dns_idx)
-    dns_idx = -1;
-  else if (n == servidx)
-    servidx = -1;
-
-
   if (dcc[n].type && dcc[n].type->kill)
     dcc[n].type->kill(n, dcc[n].u.other);
   else if (dcc[n].u.other)
@@ -605,6 +597,13 @@ lostdcc(int n)
 
   dcc[n].u.other = NULL;
 
+  if (n == uplink_idx)
+    uplink_idx = -1;
+  else if (n == dns_idx)
+    dns_idx = -1;
+  else if (n == servidx)
+    servidx = -1;
+
 //  This is also done when we new_dcc(), so don't bother for now, we set sock/type to NULL, so it won't even be 
 //  parsed by anything.
 //  bzero(&dcc[n], sizeof(struct dcc_t));