Quellcode durchsuchen

* Ported [2468] to 1.2.9

svn: 2608
Bryan Drewery vor 20 Jahren
Ursprung
Commit
de14b08dd9
2 geänderte Dateien mit 11 neuen und 31 gelöschten Zeilen
  1. 1 0
      doc/UPDATES
  2. 10 31
      src/botnet.c

+ 1 - 0
doc/UPDATES

@@ -35,6 +35,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Failed relay no longer says failed link.
 * Fixed a socket protocol error.
 * Fixed a small error in help file for 'whom'.
+* Removed some legacy code from failed relays that attempts to connect to port+1, port+2, port+3... (might fix #177)
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 10 - 31
src/botnet.c

@@ -1085,39 +1085,18 @@ static void failed_tandem_relay(int idx)
     lostdcc(idx);
     return;
   }
-  if (dcc[idx].port >= dcc[idx].u.relay->port + 3) {
-    struct chat_info *ci = dcc[uidx].u.relay->chat;
-
-    dprintf(uidx, "Could not relay to %s.\n", dcc[idx].nick);
-    dcc[uidx].status = dcc[uidx].u.relay->old_status;
-    free(dcc[uidx].u.relay);
-    dcc[uidx].u.chat = ci;
-    dcc[uidx].type = &DCC_CHAT;
-    if (dcc[idx].sock != -1)
-      killsock(dcc[idx].sock);
-    lostdcc(idx);
-    return;
-  }
+
+  struct chat_info *ci = dcc[uidx].u.relay->chat;
+
+  dprintf(uidx, "Could not relay to %s.\n", dcc[idx].nick);
+  dcc[uidx].status = dcc[uidx].u.relay->old_status;
+  free(dcc[uidx].u.relay);
+  dcc[uidx].u.chat = ci;
+  dcc[uidx].type = &DCC_CHAT;
   if (dcc[idx].sock != -1)
     killsock(dcc[idx].sock);
-#ifdef USE_IPV6
-  dcc[idx].sock = getsock(SOCK_STRONGCONN, dcc[uidx].u.relay->af);
-#else
-  dcc[idx].sock = getsock(SOCK_STRONGCONN);
-#endif /* USE_IPV6 */
-  dcc[uidx].u.relay->sock = dcc[idx].sock;
-  dcc[idx].port++;
-  dcc[idx].timeval = now;
-  if (dcc[idx].sock < 0 ||
-#ifdef USE_IPV6
-      open_telnet_raw(dcc[idx].sock, dcc[idx].host,
-#else
-      open_telnet_raw(dcc[idx].sock, dcc[idx].addr ?
-				     iptostr(htonl(dcc[idx].addr)) :
-				     dcc[idx].host, 
-#endif /* USE_IPV6 */
-      dcc[idx].port, 0) < 0)
-    failed_tandem_relay(idx);
+  lostdcc(idx);
+  return;
 }
 
 static void tandem_relay_dns_callback(int, void *, const char *, char **);