[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] Changes to mldonkey/src/networks/donkey/donkeyClient.
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] Changes to mldonkey/src/networks/donkey/donkeyClient.ml |
Date: |
Sun, 17 Jul 2005 12:51:45 -0400 |
Index: mldonkey/src/networks/donkey/donkeyClient.ml
diff -u mldonkey/src/networks/donkey/donkeyClient.ml:1.51
mldonkey/src/networks/donkey/donkeyClient.ml:1.52
--- mldonkey/src/networks/donkey/donkeyClient.ml:1.51 Sun Jul 17 16:12:59 2005
+++ mldonkey/src/networks/donkey/donkeyClient.ml Sun Jul 17 16:51:44 2005
@@ -715,11 +715,34 @@
| Field_UNKNOWN "features" ->
for_int_tag tag (fun i ->
c.client_emule_proto.emule_secident <- i land 0x3)
+ | Field_UNKNOWN "mod_version" ->
+ let s = to_lowercase (string_of_tag_value tag.tag_value) in
+ begin
+ let rec iter i len =
+ if i < len then
+ let sub = fst mod_array.(i) in
+ if (String2.subcontains s sub) then
+ c.client_mod_brand <- snd mod_array.(i)
+ else iter (i+1) len
+ in
+ iter 0 (Array.length mod_array)
+ end
| _ ->
if !verbose_msg_clients then
lprintf "Unknown Emule tag: [%s]\n" (escaped_string_of_field tag)
) tags
+let fight_disguised_mods c =
+ if (c.client_brand = Brand_mldonkey2 || c.client_brand = Brand_mldonkey3)
+ && (c.client_mod_brand = Brand_mod_morphxt || c.client_mod_brand =
Brand_mod_ionix) then
+ c.client_brand <- Brand_newemule;
+ if c.client_emule_proto.emule_release <> "" && c.client_brand =
Brand_mldonkey2 then
+ c.client_brand <- Brand_newemule;
+ if c.client_brand = Brand_edonkey && c.client_mod_brand = Brand_mod_plus
then
+ c.client_brand <- Brand_emuleplus;
+ if c.client_brand = Brand_emuleplus && c.client_mod_brand = Brand_mod_plus
then
+ c.client_mod_brand <- Brand_mod_unknown
+
let rec query_id ip port id =
let client_ip = client_ip None in
@@ -980,6 +1003,7 @@
) c.client_tags;
identify_client_brand c;
update_client_from_tags c t.CR.tags;
+ fight_disguised_mods c;
Hashtbl.add connected_clients t.CR.md4 c;
(* connection_ok c.client_connection_control; *)
if !verbose_msg_clienttags then begin
@@ -1921,7 +1945,7 @@
c.client_tags <- t.CR.tags;
identify_client_brand c;
update_client_from_tags c t.CR.tags;
-
+ fight_disguised_mods c;
begin
match c.client_source.DonkeySources.source_sock with
| NoConnection ->