Bladeren bron

* Fixed hub delinking bots for not sharing instead of just offering the userfile again. (#59)

svn: 2110
Bryan Drewery 21 jaren geleden
bovenliggende
commit
ee5a71d988
4 gewijzigde bestanden met toevoegingen van 8 en 7 verwijderingen
  1. 1 1
      doc/UPDATES
  2. 1 1
      src/dccutil.c
  3. 4 2
      src/mod/share.mod/share.c
  4. 2 3
      src/users.c

+ 1 - 1
doc/UPDATES

@@ -129,7 +129,7 @@ Lines prefixed with '-' were disabled before release and are not finishsed, or a
 * Shell cmd param -u now soft restarts all running bots after updating binary
 * Changed the output of cmd_uptime (shows in cmd_status as well)
 * Disabled auto-renaming server names internally on connect if they don't match our own list
-
+* Fixed hub delinking bots for not sharing instead of just offering the userfile again. (#59)
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 1 - 1
src/dccutil.c

@@ -565,7 +565,7 @@ tell_dcc(int idx)
   dprintf(idx, format, "----", "---", "--------", "-----", "---------",
           "----------------------------------------", "----");
 
-  egg_snprintf(format, sizeof format, "%%-4d %%-4d %%08X %%5ud %%-%us %%-40s %%s\n", nicklen);
+  egg_snprintf(format, sizeof format, "%%-4d %%-4d %%08X %%5u %%-%us %%-40s %%s\n", nicklen);
 
   dprintf(idx, "dccn: %d, dcc_total: %d\n", dccn, dcc_total);
   dprintf(idx, "dns_idx: %d, servidx: %d\n", dns_idx, servidx);

+ 4 - 2
src/mod/share.mod/share.c

@@ -1344,11 +1344,13 @@ cancel_user_xfer(int idx, void *x)
   if (idx < 0) {
     idx = -idx;
     k = 1;
+    /* turn off sharing flag */
     updatebot(-1, dcc[idx].nick, '-', 0, 0, NULL);
   }
   flush_tbuf(dcc[idx].nick);
 
   if (dcc[idx].status & STAT_SHARE) {
+    /* look for any transfers from this bot and kill them */
     if (dcc[idx].status & STAT_GETTING) {
       for (i = 0; i < dcc_total; i++)
         if (dcc[i].type && !egg_strcasecmp(dcc[i].host, dcc[idx].nick) &&
@@ -1363,11 +1365,11 @@ cancel_user_xfer(int idx, void *x)
       }
       putlog(LOG_BOTS, "*", "(Userlist download aborted.)");
     }
+    /* look for any transfers we were sending them */
     if (dcc[idx].status & STAT_SENDING) {
       for (i = 0; i < dcc_total; i++)
         if (dcc[i].type && (!egg_strcasecmp(dcc[i].host, dcc[idx].nick)) &&
-            ((dcc[i].type->flags & (DCT_FILETRAN | DCT_FILESEND))
-             == DCT_FILETRAN)) {
+            ((dcc[i].type->flags & (DCT_FILETRAN | DCT_FILESEND)) == DCT_FILETRAN)) {
           j = i;
           break;
         }

+ 2 - 3
src/users.c

@@ -1013,8 +1013,6 @@ void autolink_cycle_hub(char *start)
 	  if (strcmp(curval, bestval) < 0)
 	    strcpy(bestval, curval);
 	}
-      } else {
-  	  botunlink(-2, dcc[i].nick, "Linked but not sharing?");
       }
     }
    }
@@ -1040,8 +1038,9 @@ void autolink_cycle_hub(char *start)
   } else
     strcpy(curval, "0");
 
+  /* link to the (highlest level)/best hub */
   u = next_hub(u, bestval, curval);
-  if ((u) && (!in_chain(u->handle)))
+  if (u && !in_chain(u->handle))
     botlink("", -3, u->handle);
 }