mldonkey-bugs
[Top][All Lists]
Advanced

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

[Mldonkey-bugs] [bug #12761] Cancel is broken


From: kempston
Subject: [Mldonkey-bugs] [bug #12761] Cancel is broken
Date: Fri, 10 Jun 2005 10:16:50 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.0

Follow-up Comment #8, bug #12761 (project mldonkey):

Hmm, i remember myself checking commit code before, didn't find there anyhting
userfull, but thnx for the great tip - i've checked some traces and found out,
that in donkeyOneFile.ml in declare_completed_file function there is a code
"file.file_swarmer <- None;" that can be used as i kind of solution.

Putiing this code into donkeyInteractive.ml into begining of
file_ops.op_file_cancel function makes things working with one huge BUT.

if you start downloading, then cancel it immideatly file swarmer get's
released, but list of swarmers still remembers it, if you start another
donwnload immediatly it will tell you, you're the moron, as usually, but if
you will restart core or wait 2 minutes list will get updated and everything
will start working fine.

I've trying to fix this issue and located follwing code in
commonSwarming2.ml

let swarmers =
  define_option CommonComplexOptions.swarmers_section
    ["swarmers"] "All the swarmers used" (list_option SwarmerOption.t) []

and

let _ =
  set_after_save_hook files_ini (fun _ -> swarmers =:= []);
  set_before_save_hook files_ini (fun _ ->
      let list = ref [] in
      HS.iter (fun s ->
          if s.s_networks <> [] then
          list := s :: !list) swarmers_by_name;
      swarmers =:= !list
  );
  set_after_load_hook files_ini (fun _ ->
      List.iter (fun s ->
          check_swarmer s;
      ) !!swarmers;

      swarmers =:= [])

2nd part seems to be resposible for updating swarmers list, but list itself is
unaccessable from any other part of code :(

Unfortunatly my ocaml knowledge is not strong enought to get the trick done,
so i'd really apretiate help for one of big brothers.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=12761>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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