Changeset 31 in code for trunk/cli/pull.ml


Ignore:
Timestamp:
Nov 18, 2022, 1:41:55 PM (2 years ago)
Author:
fox
Message:

Introduce 'peers' subcommand, refactor in pull

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/pull.ml

    r30 r31  
    8787                then pull_text url dir id
    8888
     89(*TODO: integrate in lib*)
    8990let validate_id_length s = String.length s <= 32
    90 
    9191let validate_id_chars s = try
    9292        String.iter (function 'a'..'z'|'A'..'Z'|'0'..'9'-> () | _ -> raise (Invalid_argument "")) s;
     
    9595
    9696let pull_index url authors_opt topics_opt =
    97         let index_url = url ^ "/index.pck" in
     97        let index_url = Filename.concat url "index.pck" in
    9898        match curl_pull index_url with
    9999        | Error s -> prerr_endline s; false
     
    128128        let pull got_one peer_url = if got_one then got_one else
    129129                (pull_index peer_url auths topics) in
    130         Logarion.Peers.fold pull false;
     130        let fold_locations init peer =
     131                ignore @@ List.fold_left pull init peer.Logarion.Peers.locations;
     132                false
     133        in
     134        ignore @@ Logarion.Peers.fold fold_locations false;
    131135        Curl.global_cleanup ()
    132136
Note: See TracChangeset for help on using the changeset viewer.