From 7e6820f0972ac1b70d30af70a89a1cd8ab5ea5f9 Mon Sep 17 00:00:00 2001 From: spiralvoice Date: Fri, 31 Aug 2007 19:40:06 +0000 Subject: [PATCH] patch #6172 --- distrib/ChangeLog | 3 +++ src/networks/donkey/donkeyClient.ml | 2 +- src/networks/donkey/donkeyInteractive.ml | 4 ++-- src/networks/donkey/donkeyMain.ml | 8 ++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/distrib/ChangeLog b/distrib/ChangeLog index 677f5545..22b4fdcb 100644 --- a/distrib/ChangeLog +++ b/distrib/ChangeLog @@ -14,6 +14,9 @@ http://mldonkey.sourceforge.net/Windows#MinGW_Installation ChangeLog ========= +2007/08/31 +6172: EDK: properly advertise and honour noviewshared tag (TripleM) + 2007/08/23 6160: BT: Another fix for share_scan_interval - Old hard-coded default was 300s, now with share_scan_interval its diff --git a/src/networks/donkey/donkeyClient.ml b/src/networks/donkey/donkeyClient.ml index 034d1852..c75f88b7 100644 --- a/src/networks/donkey/donkeyClient.ml +++ b/src/networks/donkey/donkeyClient.ml @@ -835,7 +835,7 @@ let shared_of_file file = let query_view_files c = if CommonClient.is_must_browse (as_client c) then begin CommonClient.set_not_must_browse (as_client c); - client_send c ( + if c.client_emule_proto.emule_noviewshared <> 1 then client_send c ( let module M = DonkeyProtoClient in let module C = M.ViewFiles in M.ViewFilesReq C.t); diff --git a/src/networks/donkey/donkeyInteractive.ml b/src/networks/donkey/donkeyInteractive.ml index cbaa3b57..2ba82807 100644 --- a/src/networks/donkey/donkeyInteractive.ml +++ b/src/networks/donkey/donkeyInteractive.ml @@ -1694,13 +1694,13 @@ let _ = client_ops.op_client_browse <- (fun c immediate -> if !verbose then lprintf_nl "connecting friend %s" (full_client_identifier c); match c.client_source.DonkeySources.source_sock with - | Connection sock -> + | Connection sock when c.client_emule_proto.emule_noviewshared <> 1 -> if !verbose then lprintf_nl "retrieving filelist from friend %s" (full_client_identifier c); client_send c ( let module M = DonkeyProtoClient in let module C = M.ViewFiles in M.ViewFilesReq C.t); - | NoConnection -> + | NoConnection when c.client_emule_proto.emule_noviewshared <> 1 -> if !verbose then lprintf_nl "re-connecting friend %s" (full_client_identifier c); set_must_browse (as_client c); diff --git a/src/networks/donkey/donkeyMain.ml b/src/networks/donkey/donkeyMain.ml index 59cb57b9..973f0a07 100644 --- a/src/networks/donkey/donkeyMain.ml +++ b/src/networks/donkey/donkeyMain.ml @@ -132,6 +132,13 @@ let reset_tags () = m.emule_secident <- secident; m.emule_features <- secident; + let advertise_browse = + match !!allow_browse_share with + 1 | 2 -> 0 + | _ -> 1 + in + m.emule_noviewshared <- advertise_browse; + let emule_miscoptions1 = D.emule_miscoptions1 m in let emule_miscoptions2 = D.emule_miscoptions2 m in let emule_compatoptions = D.emule_compatoptions m in @@ -320,6 +327,7 @@ be useful when users want to share files that they had already previously Options.option_hook global_login reset_tags; Options.option_hook login reset_tags; Options.option_hook enable_sui reset_tags; + Options.option_hook allow_browse_share reset_tags; (**** START TIMERS ****) add_session_option_timer enabler check_client_connections_delay -- 2.11.4.GIT