Просмотр исходного кода

* A few fixes in update code which stopped hub from sending out binaries after a failed send.
* Hub now sends out wraith.OS-VER and doesn't bother checking for hub/leaf binary


svn: 1908

Bryan Drewery 21 лет назад
Родитель
Сommit
314fb5a144
2 измененных файлов с 14 добавлено и 12 удалено
  1. 6 3
      doc/UPDATES
  2. 8 9
      src/mod/update.mod/update.c

+ 6 - 3
doc/UPDATES

@@ -1,10 +1,13 @@
 This is a summary of ChangeLog basically.
 
-Lines prefixxed with '-' were disabled before release and are not finishsed.
+Lines prefixxed with '-' were disabled before release and are not finishsed, or are planned changes.
 
 1.2.4 (Planned updates)
-* Increased buffer size in -C for binname/binpath/homedir
-* Added tempdir option in config -C
+- Increased buffer size in -C for binname/binpath/homedir
+- Added tempdir option in config -C
+- Add back in uhost cache / hash table for invites
+- Change user system to hash table with uids
+- Change userentry system around to use strings ?
 
 1.2.3
 * HUB/LEAF binaries have been combined into 1 binary named 'wraith'

+ 8 - 9
src/mod/update.mod/update.c

@@ -85,10 +85,7 @@ static void update_ufsend(int idx, char *par)
   FILE *f = NULL;
 
   putlog(LOG_BOTS, "*", "Downloading updated binary from %s", dcc[idx].nick);
-  if (conf.bot->hub)
-    egg_snprintf(s, sizeof s, "%s.update.%s.hub", tempdir, conf.bot->nick);
-  else
-    egg_snprintf(s, sizeof s, "%s.update.%s.leaf", tempdir, conf.bot->nick);
+  egg_snprintf(s, sizeof s, "%s.update.%s", tempdir, conf.bot->nick);
   unlink(s); /* make sure there isnt already a new binary here.. */
   if (dcc_total == max_dcc) {
     putlog(LOG_MISC, "*", "NO MORE DCC CONNECTIONS -- can't grab new binary");
@@ -285,20 +282,21 @@ static void start_sending_binary(int idx)
   dcc[idx].status |= STAT_SENDINGU;
 
   putlog(LOG_BOTS, "*", "Sending binary send request to %s", dcc[idx].nick);
+
   sysname = (char *) get_user(&USERENTRY_OS, dcc[idx].user);
 
   if (!sysname || !sysname[0] || !strcmp("*", sysname)) {
-    putlog(LOG_MISC, "*", "Cannot update \002%s\002 automatically, uname not returning os name.", dcc[idx].nick);
+    putlog(LOG_MISC, "*", "Cannot update \002%s\002 automatically, `uname` not returning os name.", dcc[idx].nick);
     return;
   }
 
-  egg_snprintf(update_file, sizeof update_file, "%s.%s-%s", 
-              (bot_hublevel(dcc[idx].user) == 999) ? "leaf" : "hub", sysname, egg_version);
-
+  egg_snprintf(update_file, sizeof update_file, "wraith.%s-%s", sysname, egg_version);
   egg_snprintf(update_fpath, sizeof update_fpath, "%s/%s", conf.binpath, update_file);
 
   if (!can_stat(update_fpath)) {
-    putlog(LOG_MISC, "*", "Need to update \002%s\002 with %s, but it cannot be accessed", dcc[idx].nick, update_fpath);
+    putlog(LOG_MISC, "*", "Need to update \002%s\002 with %s but there was an error: %s", dcc[idx].nick, update_fpath,
+                           strerror(errno));
+    dcc[idx].status &= ~(STAT_SENDINGU);
     bupdating = 0;
     return;
   }
@@ -335,6 +333,7 @@ static void start_sending_binary(int idx)
 	   i == DCCSEND_BADFN  ? "BAD FILE" :
 	   i == DCCSEND_FEMPTY ? "EMPTY FILE" : "UNKNOWN REASON!");
     dcc[idx].status &= ~(STAT_SENDINGU);
+    bupdating = 0;
   } else {
     dcc[idx].status |= STAT_SENDINGU;
     strcpy(dcc[j].host, dcc[idx].nick);		/* Store bot's nick */