/[mldonkey]/mldonkey/src/networks/gnutella/gnutellaProtocol.ml
ViewVC logotype

Diff of /mldonkey/src/networks/gnutella/gnutellaProtocol.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by spiralvoice, Sat May 28 11:19:42 2005 UTC revision 1.15 by spiralvoice, Thu Jul 7 00:25:46 2005 UTC
# Line 242  let cached_qrt_table = ref "" Line 242  let cached_qrt_table = ref ""
242    
243  let update_shared_words () =  let update_shared_words () =
244    if !verbose_share then    if !verbose_share then
245      lprintf "update_shared_words\n";      lprintf_nl "update_shared_words";
246    all_shared_words := [];    all_shared_words := [];
247    cached_qrt_table := "";    cached_qrt_table := "";
248    let module M = CommonUploads in    let module M = CommonUploads in
# Line 257  let update_shared_words () = Line 257  let update_shared_words () =
257      List.iter (fun sh ->      List.iter (fun sh ->
258          let info = IndexedSharedFiles.get_result sh.shared_info in          let info = IndexedSharedFiles.get_result sh.shared_info in
259          if !verbose_share then          if !verbose_share then
260            lprintf "CODED name: %s\n" sh.M.shared_codedname;            lprintf_nl "CODED name: %s" sh.M.shared_codedname;
261          register_words sh.M.shared_codedname;          register_words sh.M.shared_codedname;
262          List.iter (fun uid ->          List.iter (fun uid ->
263              words := WordSet.add (Uid.to_string uid) !words              words := WordSet.add (Uid.to_string uid) !words
# Line 278  let update_shared_words () = Line 278  let update_shared_words () =
278        List.iter (fun s ->        List.iter (fun s ->
279          lprintf "%s " s          lprintf "%s " s
280        ) !all_shared_words;        ) !all_shared_words;
281        lprint_newline ()        lprintf_nl ""
282      end      end
283    
284                    
# Line 315  let parse_headers c first_line headers = Line 315  let parse_headers c first_line headers =
315            List.assoc "x-gnutella-alternate-location" headers in            List.assoc "x-gnutella-alternate-location" headers in
316          let locations = String2.split locations ',' in          let locations = String2.split locations ',' in
317                    
318          lprintf "Alternate locations\n";          lprintf_nl "Alternate locations";
319          let urls = List.map (fun s ->          let urls = List.map (fun s ->
320                match String2.split_simplify s ' ' with                match String2.split_simplify s ' ' with
321                  [] -> lprintf "Cannot parse : %s\n" s; ""                  [] -> lprintf_nl "Cannot parse : %s" s; ""
322                | url :: _ ->                | url :: _ ->
323                    lprintf "  Location: %s\n" url; url                    lprintf_nl "  Location: %s" url; url
324            ) locations in            ) locations in
325          lprintf "\n";          lprintf_nl "";
326                    
327          let files = ref [] in          let files = ref [] in
328          (try          (try
# Line 523  let find_file_to_upload gconn url = Line 523  let find_file_to_upload gconn url =
523        match url.Url.args with        match url.Url.args with
524          [(urn,_)] ->          [(urn,_)] ->
525            if !verbose_msg_clients then            if !verbose_msg_clients then
526              lprintf "Found /uri-res/N2R request\n";              lprintf_nl "Found /uri-res/N2R request";
527            find_by_uid (Uid.of_string urn)            find_by_uid (Uid.of_string urn)
528                
529        | _ -> failwith "Cannot parse /uri-res/N2R request"        | _ -> failwith "Cannot parse /uri-res/N2R request"
# Line 534  let find_file_to_upload gconn url = Line 534  let find_file_to_upload gconn url =
534      let num = String.sub file 5 (pos - 5) in      let num = String.sub file 5 (pos - 5) in
535      let filename = String.sub file (pos+1) (String.length file - pos - 1) in      let filename = String.sub file (pos+1) (String.length file - pos - 1) in
536      if !verbose_msg_clients then      if !verbose_msg_clients then
537        lprintf "Download of file %s, filename = %s\n" num filename;        lprintf_nl "Download of file %s, filename = %s" num filename;
538      let num = int_of_string num in      let num = int_of_string num in
539      Hashtbl.find shareds_by_id  num      Hashtbl.find shareds_by_id  num
540    in    in

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26