Sfoglia il codice sorgente

* Corrupt userfile and bad uff parsing was not relinking on the right idx.

svn: 760
Bryan Drewery 22 anni fa
parent
commit
8106ab1547
1 ha cambiato i file con 17 aggiunte e 7 eliminazioni
  1. 17 7
      src/mod/share.mod/share.c

+ 17 - 7
src/mod/share.mod/share.c

@@ -1706,14 +1706,24 @@ static void finish_share(int idx)
     return;
 
   if (!uff_call_receiving(j, dcc[idx].u.xfer->filename)) {
-    putlog(LOG_BOTS, "@", "A uff parsing function failed for the userfile!");
+    char xx[1024] = "";
+
+    putlog(LOG_BOTS, "*", "A uff parsing function failed for the userfile!");
     unlink(dcc[idx].u.xfer->filename);
+
+    dprintf(j, "bye\n");
+    egg_snprintf(xx, sizeof xx, "Disconnected %s (uff error)", dcc[j].nick);
+    botnet_send_unlinked(j, dcc[j].nick, xx);
+    chatout("*** %s\n", xx);
+
+    killsock(dcc[j].sock);
+    lostdcc(j);
+
     return;
   }
 
   if (dcc[j].u.bot->uff_flags & UFF_OVERRIDE)
-    debug1("NOTE: Sharing passively with %s, overriding local bots.",
-	   dcc[j].nick);
+    debug1("NOTE: Sharing passively with %s, overriding local bots.", dcc[j].nick);
   else
     /* Copy the bots over. The entries will be used in the new user list. */
     u = dup_userlist(1);
@@ -1788,12 +1798,12 @@ Context;
     checkchans(2); 		/* un-flag the channels, we are keeping them.. */
 
     dprintf(idx, "bye\n");
-    egg_snprintf(xx, sizeof xx, "Disconnected %s (can't read userfile)", dcc[idx].nick);
-    botnet_send_unlinked(idx, dcc[idx].nick, xx);
+    egg_snprintf(xx, sizeof xx, "Disconnected %s (can't read userfile)", dcc[j].nick);
+    botnet_send_unlinked(j, dcc[j].nick, xx);
     chatout("*** %s\n", xx);
 
-    killsock(dcc[idx].sock);
-    lostdcc(idx);
+    killsock(dcc[j].sock);
+    lostdcc(j);
 
     return;
   }