X-Git-Url: https://git.rkrishnan.org/?a=blobdiff_plain;f=src%2Fmain%2FMain.hs;h=ae3c0354e76a7b714db629388211551bd091600f;hb=dfffc353671f9cb53f4c95fcd81cac807a07201e;hp=0a514104703485beda12b9206226fe44acbb6bc5;hpb=6b81eef44adef685430b0d3ad58062e05171e54d;p=functorrent.git diff --git a/src/main/Main.hs b/src/main/Main.hs index 0a51410..ae3c035 100644 --- a/src/main/Main.hs +++ b/src/main/Main.hs @@ -57,9 +57,13 @@ main = do case torrentToMetainfo torrentStr of Left e -> logError e log Right m -> do - log "Input File OK" - log $ "Downloading file : " ++ name (info m) - + let p = name (info m) + log $ "Downloading file : " ++ p + -- if we had downloaded the file before (partly or completely) + -- then we should check the current directory for the existence + -- of the file and then update the map of each piece' availability. + -- This can be donw by reading each piece and verifying the checksum. + -- If the checksum does not match, we don't have that piece. log $ "starting server" (serverSock, (PortNumber portnum)) <- Server.start log $ "server started on " ++ show portnum