Bryan Drewery %!s(int64=21) %!d(string=hai) anos
pai
achega
52d8297423
Modificáronse 3 ficheiros con 18 adicións e 1 borrados
  1. 3 0
      src/dcc.c
  2. 13 0
      src/enclink.c
  3. 2 1
      src/enclink.h

+ 3 - 0
src/dcc.c

@@ -1628,6 +1628,9 @@ dcc_telnet_id(int idx, char *buf, int atr)
       dcc[idx].u.dupwait->atr = atr;
       dcc[idx].u.dupwait->atr = atr;
       return;
       return;
     }
     }
+  
+    dcc[idx].u.enc = (struct enc_link_dcc *) my_calloc(1, sizeof(struct enc_link_dcc));
+    link_get_method(idx);
   } else {
   } else {
     //bots dont need this
     //bots dont need this
     dcc[idx].u.chat = (struct chat_info *) my_calloc(1, sizeof(struct chat_info));
     dcc[idx].u.chat = (struct chat_info *) my_calloc(1, sizeof(struct chat_info));

+ 13 - 0
src/enclink.c

@@ -402,6 +402,19 @@ void link_parse(int idx, char *buf)
   return;
   return;
 }
 }
 
 
+void link_get_method(int idx)
+{
+  if (!dcc[idx].type)
+    return;
+
+  int n = dcc[idx].u.enc->method_number;
+
+  if (enclink[n].name)
+    dcc[idx].u.enc->method = &(enclink[n]);
+
+  dcc[idx].u.enc->method_number++;
+}
+
 /* the order of entries here determines which will be picked */
 /* the order of entries here determines which will be picked */
 struct enc_link enclink[] = {
 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 },

+ 2 - 1
src/enclink.h

@@ -32,7 +32,7 @@ struct enc_link {
 
 
 struct enc_link_dcc {
 struct enc_link_dcc {
   struct enc_link *method;
   struct enc_link *method;
-  int status;
+  int method_number;
 };
 };
 
 
 extern struct enc_link enclink[];
 extern struct enc_link enclink[];
@@ -47,5 +47,6 @@ extern void link_hash(int, char *);
 extern void link_send(int, const char *, ...) __attribute__((format(printf, 2, 3)));
 extern void link_send(int, const char *, ...) __attribute__((format(printf, 2, 3)));
 extern void link_done(int);
 extern void link_done(int);
 extern void link_parse(int, char *);
 extern void link_parse(int, char *);
+extern void link_get_method(int);
 
 
 #endif /* !_ENCLINK_H */
 #endif /* !_ENCLINK_H */