715 |
| Field_UNKNOWN "features" -> |
| Field_UNKNOWN "features" -> |
716 |
for_int_tag tag (fun i -> |
for_int_tag tag (fun i -> |
717 |
c.client_emule_proto.emule_secident <- i land 0x3) |
c.client_emule_proto.emule_secident <- i land 0x3) |
718 |
|
| Field_UNKNOWN "mod_version" -> |
719 |
|
let s = to_lowercase (string_of_tag_value tag.tag_value) in |
720 |
|
begin |
721 |
|
let rec iter i len = |
722 |
|
if i < len then |
723 |
|
let sub = fst mod_array.(i) in |
724 |
|
if (String2.subcontains s sub) then |
725 |
|
c.client_mod_brand <- snd mod_array.(i) |
726 |
|
else iter (i+1) len |
727 |
|
in |
728 |
|
iter 0 (Array.length mod_array) |
729 |
|
end |
730 |
| _ -> |
| _ -> |
731 |
if !verbose_msg_clients then |
if !verbose_msg_clients then |
732 |
lprintf "Unknown Emule tag: [%s]\n" (escaped_string_of_field tag) |
lprintf "Unknown Emule tag: [%s]\n" (escaped_string_of_field tag) |
733 |
) tags |
) tags |
734 |
|
|
735 |
|
let fight_disguised_mods c = |
736 |
|
if (c.client_brand = Brand_mldonkey2 || c.client_brand = Brand_mldonkey3) |
737 |
|
&& (c.client_mod_brand = Brand_mod_morphxt || c.client_mod_brand = Brand_mod_ionix) then |
738 |
|
c.client_brand <- Brand_newemule; |
739 |
|
if c.client_emule_proto.emule_release <> "" && c.client_brand = Brand_mldonkey2 then |
740 |
|
c.client_brand <- Brand_newemule; |
741 |
|
if c.client_brand = Brand_edonkey && c.client_mod_brand = Brand_mod_plus then |
742 |
|
c.client_brand <- Brand_emuleplus; |
743 |
|
if c.client_brand = Brand_emuleplus && c.client_mod_brand = Brand_mod_plus then |
744 |
|
c.client_mod_brand <- Brand_mod_unknown |
745 |
|
|
746 |
let rec query_id ip port id = |
let rec query_id ip port id = |
747 |
let client_ip = client_ip None in |
let client_ip = client_ip None in |
748 |
|
|
1003 |
) c.client_tags; |
) c.client_tags; |
1004 |
identify_client_brand c; |
identify_client_brand c; |
1005 |
update_client_from_tags c t.CR.tags; |
update_client_from_tags c t.CR.tags; |
1006 |
|
fight_disguised_mods c; |
1007 |
Hashtbl.add connected_clients t.CR.md4 c; |
Hashtbl.add connected_clients t.CR.md4 c; |
1008 |
(* connection_ok c.client_connection_control; *) |
(* connection_ok c.client_connection_control; *) |
1009 |
if !verbose_msg_clienttags then begin |
if !verbose_msg_clienttags then begin |
1945 |
c.client_tags <- t.CR.tags; |
c.client_tags <- t.CR.tags; |
1946 |
identify_client_brand c; |
identify_client_brand c; |
1947 |
update_client_from_tags c t.CR.tags; |
update_client_from_tags c t.CR.tags; |
1948 |
|
fight_disguised_mods c; |
1949 |
begin |
begin |
1950 |
match c.client_source.DonkeySources.source_sock with |
match c.client_source.DonkeySources.source_sock with |
1951 |
| NoConnection -> |
| NoConnection -> |