Kaynağa Gözat

* Fixed a bug with connecting to servers that did not send any data on connect.

svn: 1965
Bryan Drewery 21 yıl önce
ebeveyn
işleme
acd6a2f9fd
3 değiştirilmiş dosya ile 7 ekleme ve 7 silme
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/main.c
  3. 5 6
      src/mod/server.mod/servmsg.c

+ 1 - 0
doc/UPDATES

@@ -55,6 +55,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Fixed userfile becoming desynced during transfer; A bot downloading a userfile would miss changes made during the transfer. (#11)
 * Fixed a problem with accepting new telnet connections.
 * Fixed segfault after booting users when a leaf has lost +c. (#18)
+* Fixed a bug with connecting to servers that did not send any data on connect.
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 1 - 1
src/main.c

@@ -593,7 +593,7 @@ static void startup_checks(int hack) {
     } else {
       /* this needs to be both hub/leaf */
       if (update_bin) {					/* invokved with -u/-U */
-        if (updating == UPDATE_AUTO && conf.bot->pid) {		/* invoked with -u bin, so kill  */
+        if (updating == UPDATE_AUTO && conf.bot && conf.bot->pid) {		/* invoked with -u bin, so kill  */
           
           kill(conf.bot->pid, SIGKILL);
           unlink(conf.bot->pid_file);

+ 5 - 6
src/mod/server.mod/servmsg.c

@@ -979,11 +979,6 @@ static void server_activity(int idx, char *msg, int len)
     strcpy(dcc[idx].nick, "(server)");
     putlog(LOG_SERV, "*", "Connected to %s", dcc[idx].host);
 
-    if (serverpass[0])
-      dprintf(DP_MODE, "PASS %s\n", serverpass);
-    dprintf(DP_MODE, "NICK %s\n", botname);
-    dprintf(DP_MODE, "USER %s localhost %s :%s\n", botuser, dcc[idx].host, botrealname);
-
     trying_server = 0;
     /*
     servidx = idx;
@@ -1426,6 +1421,10 @@ static void server_dns_callback(int id, void *client_data, const char *host, cha
     /* Start alternate nicks from the beginning */
     altnick_char = 0;
 
-    /* Wait for async connect now */
+    if (serverpass[0])
+      dprintf(DP_MODE, "PASS %s\n", serverpass);
+    dprintf(DP_MODE, "NICK %s\n", botname);
+    dprintf(DP_MODE, "USER %s localhost %s :%s\n", botuser, dcc[idx].host, botrealname);
+    /* Wait for async result now */
   }
 }