فهرست منبع

* Removed old compatability code for linking

svn: 1771
Bryan Drewery 21 سال پیش
والد
کامیت
57b763a3d6
4فایلهای تغییر یافته به همراه14 افزوده شده و 73 حذف شده
  1. 1 0
      doc/UPDATES
  2. 11 63
      src/dcc.c
  3. 0 1
      src/dcc.h
  4. 2 9
      src/enclink.c

+ 1 - 0
doc/UPDATES

@@ -11,6 +11,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed.
 * cmd_mns_user cosmetic change
 * cmd_mns_user cosmetic change
 * Added cmdline option '-r <botname>' for restarting/starting specified bot.
 * Added cmdline option '-r <botname>' for restarting/starting specified bot.
 * Typos in help for 'info'
 * Typos in help for 'info'
+* Removed compatability code left from 1.2->1.2.1 switch
 
 
 1.2.2
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 11 - 63
src/dcc.c

@@ -293,26 +293,9 @@ cont_link(int idx, char *buf, int ii)
   dcc[idx].type = &DCC_BOT_NEW;
   dcc[idx].type = &DCC_BOT_NEW;
   dcc[idx].u.bot->numver = 0;
   dcc[idx].u.bot->numver = 0;
 
 
-/* FIXME: remove after 1.2.2 */
-/* need to support the posibility of old hubs being up */
-  if (ii == 2) {
-    dprintf(idx, "%s\n", conf.bot->nick);
-
-    int snum = findanysnum(dcc[idx].sock);
-
-    if (snum >= 0) {
-      socklist[snum].enclink = link_find_by_type(LINK_GHOST);
-      link_link(idx, LINK_GHOST, -1, TO);
-    }
-
-    /* wait for "elink" now */
-  } else if (ii == 3) {			/* new hub response */
+  if (ii == 3)
     dprintf(idx, "-%s\n", conf.bot->nick);
     dprintf(idx, "-%s\n", conf.bot->nick);
-    dcc[idx].newbot = 1;
-
     /* wait for "neg?" now */
     /* wait for "neg?" now */
-  }
-
 
 
   /* now we wait to negotiate an encryption */
   /* now we wait to negotiate an encryption */
   return;
   return;
@@ -330,25 +313,6 @@ dcc_bot_new(int idx, char *buf, int x)
     greet_new_bot(idx);
     greet_new_bot(idx);
   } else if (!egg_strcasecmp(code, "v")) {
   } else if (!egg_strcasecmp(code, "v")) {
     bot_version(idx, buf);
     bot_version(idx, buf);
-
-/* FIXME: remove after 1.2.2 */
-  } else if (!egg_strcasecmp(code, "elink")) { /* we're connecting to THEM (old) */
-    int snum = findanysnum(dcc[idx].sock);
-
-    /* putlog(LOG_DEBUG, "*", "Got elink: %s %s", code, buf); */
-    /* Set the socket key and we're linked */
-
-    if (snum >= 0) {
-      char *tmp = decrypt_string(settings.salt2, newsplit(&buf));
-
-      strlcpy(socklist[snum].okey, tmp, sizeof(socklist[snum].okey));
-      strlcpy(socklist[snum].ikey, socklist[snum].okey, sizeof(socklist[snum].ikey));
-      socklist[snum].iseed = atoi(buf);
-      socklist[snum].oseed = atoi(buf);
-      dprintf(idx, "elinkdone\n");
-      putlog(LOG_BOTS, "*", "Handshake with %s succeeded, we're linked.", dcc[idx].nick);
-      free(tmp);
-    }
   } else if (!egg_strcasecmp(code, "neg!")) {	/* something to parse in enclink.c */
   } else if (!egg_strcasecmp(code, "neg!")) {	/* something to parse in enclink.c */
     link_parse(idx, buf);
     link_parse(idx, buf);
   } else if (!egg_strcasecmp(code, "neg?")) {	/* we're connecting to THEM */
   } else if (!egg_strcasecmp(code, "neg?")) {	/* we're connecting to THEM */
@@ -928,8 +892,7 @@ dcc_chat_pass(int idx, char *buf, int atr)
   if (dcc[idx].user->bot) {
   if (dcc[idx].user->bot) {
     if (!egg_strcasecmp(pass, "neg!")) {		/* we're the hub */
     if (!egg_strcasecmp(pass, "neg!")) {		/* we're the hub */
       link_parse(idx, buf);
       link_parse(idx, buf);
-/* FIXME: remove after 1.2.2 */
-    } else if (!egg_strcasecmp(pass, "neg.") || !egg_strcasecmp(pass, "elinkdone")) {		/* we're done, link up! */
+    } else if (!egg_strcasecmp(pass, "neg.")) {		/* we're done, link up! */
       free(dcc[idx].u.chat);
       free(dcc[idx].u.chat);
       dcc[idx].type = &DCC_BOT_NEW;
       dcc[idx].type = &DCC_BOT_NEW;
       dcc[idx].u.bot = (struct bot_info *) my_calloc(1, sizeof(struct bot_info));
       dcc[idx].u.bot = (struct bot_info *) my_calloc(1, sizeof(struct bot_info));
@@ -1540,7 +1503,6 @@ dcc_telnet_id(int idx, char *buf, int atr)
   strip_telnet(dcc[idx].sock, nick, &atr);
   strip_telnet(dcc[idx].sock, nick, &atr);
 
 
   if (nick[0] == '-') {
   if (nick[0] == '-') {
-    dcc[idx].newbot = 1; 		/* FIXME: remove after 1.2.2 */
     nick++;
     nick++;
     bot = 1;
     bot = 1;
   }
   }
@@ -1549,16 +1511,13 @@ dcc_telnet_id(int idx, char *buf, int atr)
 
 
   dcc[idx].user = get_user_by_handle(userlist, nick);
   dcc[idx].user = get_user_by_handle(userlist, nick);
 
 
-  /* FIXME: remove after 1.2.2 */
-  /* FIXME: ENABLE this afer 1.2.2 */
-/*
   if (!bot && dcc[idx].user->bot) {
   if (!bot && dcc[idx].user->bot) {
     putlog(LOG_WARN, "*", "Refused %s (fake bot login for '%s')", dcc[idx].host, nick);
     putlog(LOG_WARN, "*", "Refused %s (fake bot login for '%s')", dcc[idx].host, nick);
     killsock(dcc[idx].sock);
     killsock(dcc[idx].sock);
     lostdcc(idx);
     lostdcc(idx);
     return;
     return;
   }
   }
-*/
+
   bool ok = 0;
   bool ok = 0;
 
 
   if (dcc[idx].user) {
   if (dcc[idx].user) {
@@ -1642,28 +1601,18 @@ dcc_telnet_pass(int idx, int atr)
 
 
 #ifdef HUB
 #ifdef HUB
   if (glob_bot(fr)) {
   if (glob_bot(fr)) {
-    /* FIXME: remove after 1.2.2 */
-    if (!dcc[idx].newbot) {
-      int snum = findanysnum(dcc[idx].sock);
-
-      if (snum >= 0) {
-        socklist[snum].enclink = link_find_by_type(LINK_GHOST);
-        link_link(idx, LINK_GHOST, -1, FROM);
-      }
-    } else {
-      /* negotiate a new linking scheme */
-      int i = 0;
-      char buf[1024] = "", rand[51] = "";
+    /* negotiate a new linking scheme */
+    int i = 0;
+    char buf[1024] = "", rand[51] = "";
   
   
-      make_rand_str(rand, 50);
+    make_rand_str(rand, 50);
 
 
-      link_hash(idx, rand);
+    link_hash(idx, rand);
 
 
-      for (i = 0; enclink[i].name; i++)
-        sprintf(buf, "%s%d ", buf[0] ? buf : "", enclink[i].type);
+    for (i = 0; enclink[i].name; i++)
+      sprintf(buf, "%s%d ", buf[0] ? buf : "", enclink[i].type);
 
 
-      dprintf(idx, "neg? %s %s\n", rand, buf);
-    }
+    dprintf(idx, "neg? %s %s\n", rand, buf);
   } else
   } else
     /* Turn off remote telnet echo (send IAC WILL ECHO). */
     /* Turn off remote telnet echo (send IAC WILL ECHO). */
     dprintf(idx, "\n%s" TLN_IAC_C TLN_WILL_C TLN_ECHO_C "\n", DCC_ENTERPASS);
     dprintf(idx, "\n%s" TLN_IAC_C TLN_WILL_C TLN_ECHO_C "\n", DCC_ENTERPASS);
@@ -1926,7 +1875,6 @@ dcc_telnet_got_ident(int i, char *host)
 /* n  ssl_link(dcc[i].sock, ACCEPT_SSL); */
 /* n  ssl_link(dcc[i].sock, ACCEPT_SSL); */
 #ifdef HUB
 #ifdef HUB
   dprintf(i, " \n");			/* represents hub that support new linking scheme */
   dprintf(i, " \n");			/* represents hub that support new linking scheme */
-					/* FIXME: remove after 1.2.2? back to '\n' */
 #else /* !HUB */
 #else /* !HUB */
   dprintf(i, "%s\n", response(RES_USERNAME));
   dprintf(i, "%s\n", response(RES_USERNAME));
 #endif /* HUB */
 #endif /* HUB */

+ 0 - 1
src/dcc.h

@@ -52,7 +52,6 @@ struct dcc_t {
   int msgc;			/* forward the output back to irc? */
   int msgc;			/* forward the output back to irc? */
   int whowas;
   int whowas;
   int dns_id;
   int dns_id;
-  int newbot;		/*FIXME: remove after 1.2.2 */
   port_t port;
   port_t port;
   char simulbot[NICKLEN];       /* used for hub->leaf cmd simulation, holds bot that results should be sent to */
   char simulbot[NICKLEN];       /* used for hub->leaf cmd simulation, holds bot that results should be sent to */
   char hash[MD5_HASH_LENGTH + 1];                /* used for dcc authing */
   char hash[MD5_HASH_LENGTH + 1];                /* used for dcc authing */

+ 2 - 9
src/enclink.c

@@ -233,11 +233,7 @@ void ghost_parse(int idx, int snum, char *buf)
     socklist[snum].oseed = atoi(buf);
     socklist[snum].oseed = atoi(buf);
     putlog(LOG_BOTS, "*", "Handshake with %s succeeded, we're linked.", dcc[idx].nick);
     putlog(LOG_BOTS, "*", "Handshake with %s succeeded, we're linked.", dcc[idx].nick);
     free(tmp);
     free(tmp);
-    if (dcc[idx].newbot)
-      link_done(idx);
-    else
-/* FIXME: remove after 1.2.2 */
-      dprintf(idx, "elinkdone\n");
+    link_done(idx);
   }
   }
 }
 }
 
 
@@ -251,10 +247,7 @@ void link_send(int idx, char *format, ...)
   va_end(va);
   va_end(va);
   remove_crlf(s);
   remove_crlf(s);
 
 
-  if (dcc[idx].newbot) 
-    dprintf(idx, "neg! %s\n", s);
-  else
-    dprintf(idx, "%s\n", s);
+  dprintf(idx, "neg! %s\n", s);
 }
 }
 
 
 void link_done(int idx)
 void link_done(int idx)