mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mldonkey-users] Investigation: No download for some, full download


From: MLdonkey
Subject: Re: [Mldonkey-users] Investigation: No download for some, full downloads for the other
Date: Tue, 24 Dec 2002 00:27:09 +0100

Looking at the sources, I found what look like a reason why downloads
are low: current mldonkey cannot download from incoming connections! 

The reason is in donkeyClients.ml:

...

let query_files c sock =  
  let nall_queries = ref 0 in
  let nqueries = ref 0 in
  if last_time () -. c.client_last_filereqs > !!min_reask_delay then
  begin
      List.iter (fun file ->
          incr nall_queries;
          if file_state file = FileDownloading then
            direct_client_send sock (
              let module M = DonkeyProtoClient in
              let module C = M.QueryFile in
              M.QueryFileReq file.file_md4);          
          incr nqueries
      ) (* !current_files *) c.client_source_for;

...


For an incoming connection, we don't know anything about the client,
so c.client_source_for = [], and we never ask for files...

So, change this in (just the last line):

let query_files c sock =
  let nall_queries = ref 0 in
  let nqueries = ref 0 in
  if last_time () -. c.client_last_filereqs > !!min_reask_delay then
  begin
      List.iter (fun file ->
          incr nall_queries;
          if file_state file = FileDownloading then
            direct_client_send sock (
              let module M = DonkeyProtoClient in
              let module C = M.QueryFile in
              M.QueryFileReq file.file_md4);
          incr nqueries
      )  (if c.client_source_for = [] then !current_files 
          else c.client_source_for);

and tell me if your downloads are improved...

- MLDonkey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]