From 3b0de0fd382823328dd3bbd7439b72b7a7758b01 Mon Sep 17 00:00:00 2001 From: fredrik Date: Sun, 23 Oct 2005 02:58:16 +0000 Subject: [PATCH] Pass hashes to daemon when downloading. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@417 959494ce-11ee-0310-bf91-de5d638817bd --- lib/guile/autodl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/guile/autodl b/lib/guile/autodl index f57423f..fef6b70 100755 --- a/lib/guile/autodl +++ b/lib/guile/autodl @@ -114,6 +114,8 @@ (cadr (cdr (assoc 'peer sr))) (cdr (assoc 'filename sr)) (cdr (assoc 'size sr))))) + (let ((hash (assoc 'hash sr))) + (if (and hash (not (equal? (cdr hash) ""))) (set! args (append args (list "hash" (cdr hash)))))) (let ((tag (assoc 'tag session))) (if tag (set! args (append args (list "tag" (cdr tag)))))) (let ((uarg (assoc 'uarg session))) @@ -316,7 +318,7 @@ retval) ) -(define (handlesr filename fnet peer size slots resptime) +(define (handlesr filename fnet peer size slots resptime hash) (let ((cl (or (assoc size sr) (let ((newp (cons size '()))) (set! sr (append sr (list newp))) newp))) (newsr (list @@ -326,6 +328,7 @@ (cons 'slots slots) (cons 'resptime resptime) (cons 'speed (getspeed peer)) + (cons 'hash hash) (cons 'recvtime (current-time)) (cons 'dis #f))) (newlist '())) @@ -499,7 +502,7 @@ (set! lastsearch (current-time)))))) ((622) ; Search result (let ((ires (list->vector (dc-intresp resp)))) - (if (and ires (= (vector-ref ires 0) srchid)) (apply handlesr (map (lambda (n) (vector-ref ires n)) '(1 2 3 4 5 7)))))) + (if (and ires (= (vector-ref ires 0) srchid)) (apply handlesr (map (lambda (n) (vector-ref ires n)) '(1 2 3 4 5 7 8)))))) ) ) -- 2.11.0