From ce9a55a51503aa78f56fe4495770546f90f51e4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tom=C3=A1=C5=A1=20Brada?= Date: Tue, 29 Dec 2015 21:06:03 +0100 Subject: [PATCH] The Upload (FS) shoud work. Not tested. --- Upload.pas | 10 +++++----- brodnetd.pas | 6 +++--- todo.txt | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Upload.pas b/Upload.pas index 34a0030..c1adaa3 100644 --- a/Upload.pas +++ b/Upload.pas @@ -26,7 +26,7 @@ tPrv=object procedure Start; procedure Close; procedure Close(tell:boolean); overload; inline; - procedure ChatTimeout(willwait:LongWord); + procedure ChatTimeout; end; tAggr=object thr:tUploadThr; @@ -252,7 +252,8 @@ procedure tPrv.Init(var nchat:tChat); begin ch:=@nchat; ch^.Callback:=@OnMsg; - ch^.TMHook:=@ChatTimeout; + ch^.OnTimeout:=@ChatTimeout; + ch^.SetTimeout(8000,0); uc.weight:=100; isOpen:=false; Active:=false; Shedule(5000,@Close); @@ -306,9 +307,8 @@ procedure tPrv.Close; Close(true); end; -procedure tPrv.ChatTimeout(willwait:LongWord); +procedure tPrv.ChatTimeout; begin - if WillWait<8000 then exit; writeln('Upload: prv for ',string(ch^.remote),'/',chan,' ChatTimeout'); Close(false); end; @@ -434,4 +434,4 @@ end; BEGIN Peers:=nil; SetChatHandler(opcode.upFileServer,@ChatHandler); -END. \ No newline at end of file +END. diff --git a/brodnetd.pas b/brodnetd.pas index ab22896..731a84a 100644 --- a/brodnetd.pas +++ b/brodnetd.pas @@ -5,9 +5,9 @@ uses cthreads,ServerLoop ,TestWatch ,TestChat ,AsyncProcess - //,Upload - //,Download - //,TestFS + ,Upload + ,Download + ,TestFS ,dht ,dhtBootStatic ,dhtPersist diff --git a/todo.txt b/todo.txt index 7af0bac..2e1a7ca 100644 --- a/todo.txt +++ b/todo.txt @@ -13,6 +13,7 @@ directory: ? voting To-Do list +- Upload: use chat's reply-timeout feature - Replce Sha1 with truncated sha512 - Chat: OnTimeout, ExceptReply - handle timeouts in Download -- 2.11.4.GIT