Explorar o código

* Fixed a bug with enclink negociating which prevents bots from using NEW methods.
* Reverted patch for botnick case fix for linking (will have to come in 1.2.4)


svn: 1977

Bryan Drewery %!s(int64=21) %!d(string=hai) anos
pai
achega
703562627d
Modificáronse 3 ficheiros con 13 adicións e 10 borrados
  1. 1 1
      doc/UPDATES
  2. 10 8
      src/dcc.c
  3. 2 1
      src/enclink.c

+ 1 - 1
doc/UPDATES

@@ -8,6 +8,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 - Add back in uhost cache / hash table for invites
 - Change user system to hash table with uids
 - Change userentry system around to use strings ?
+- Fixed bot's not being able to link when the botnick case did not match (userlist vs binary -C).
 
 1.2.3
 * HUB/LEAF binaries have been combined into 1 binary named 'wraith'
@@ -56,7 +57,6 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * 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.
-* Fixed bot's not being able to link when the botnick case did not match (userlist vs binary -C).
 * Fixed colors still showing for characters ":@()<>" when colors were turned off.
 * Reverted patch from 1.2 which disabled removing duplicate msgs in server queue. (Fixes most queue/excess flood bugs)
 * Users can no longer whois PERM OWNERS unless they are themselves one.

+ 10 - 8
src/dcc.c

@@ -315,18 +315,20 @@ dcc_bot_new(int idx, char *buf, int x)
       char *rand = newsplit(&buf), *tmp = strdup(buf), *tmpp = tmp, *p = NULL;
       int i = -1;
 
-      while ((p = strchr(buf, ' ')) && i == -1) {
-        *p = 0;
+      while ((p = newsplit(&tmp))[0]) {
+        if (str_isdigit(p)) {
+          int type = atoi(p);
 
-        /* pick the first (lowest num) one that we share */
-        if ((i = link_find_by_type(atoi(tmp))) != -1)
-          break;
+          /* pick the first (lowest num) one that we share */
+          i = link_find_by_type(type);
 
-        tmp = p++;
+          if (i != -1)
+            break;
+        }
       }
       free(tmpp);
 
-      sdprintf("Choosing '%s' for link", enclink[i].name);
+      sdprintf("Choosing '%s' (%d) for link", enclink[i].name, i);
       link_hash(idx, rand);
       dprintf(idx, "neg %s %d\n", dcc[idx].shahash, enclink[i].type);
       socklist[snum].enclink = i;
@@ -908,7 +910,7 @@ dcc_chat_pass(int idx, char *buf, int atr)
 
         /* verify we have that type and then initiate it */
         if ((i = link_find_by_type(type)) == -1) {
-          putlog(LOG_WARN, "*", "%s attempted to link with an invalid encryption.", dcc[idx].nick);
+          putlog(LOG_WARN, "*", "%s attempted to link with an invalid encryption. (%d)", dcc[idx].nick, type);
           killsock(dcc[idx].sock);
           lostdcc(idx);
           return;

+ 2 - 1
src/enclink.c

@@ -328,8 +328,9 @@ void link_parse(int idx, char *buf)
   return;
 }
 
+/* the order of entries here determines which will be picked */
 struct enc_link enclink[] = {
-  { "ghost+case", LINK_GHOSTCASE, ghost_link_case, ghost_write, ghost_read, ghost_parse },
+//  { "ghost+case", LINK_GHOSTCASE, ghost_link_case, ghost_write, ghost_read, ghost_parse },
   { "ghost+nat", LINK_GHOSTNAT, ghost_link_nat, ghost_write, ghost_read, ghost_parse },
   { "cleartext", LINK_CLEARTEXT, NULL, NULL, NULL, NULL },
   { NULL, 0, NULL, NULL, NULL, NULL }