X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fguile%2Fautodl;h=281c2364e6b68e46ce7dd2cd22baddbc5617a484;hb=23d33e0ed6b2365d1f2b9db37e3a93ab8717e446;hp=d9e291b20a3e381b3f5859deabca5c09d100b54c;hpb=d30cc4bc2d85a606d156bad960f9f6d73c14a335;p=doldaconnect.git diff --git a/lib/guile/autodl b/lib/guile/autodl index d9e291b..281c236 100755 --- a/lib/guile/autodl +++ b/lib/guile/autodl @@ -211,7 +211,8 @@ (cons 'realsr info-numreal) (cons 'totalsr info-numtotal) (cons 'lastsrch lastsearch) - (cons 'srcheta info-searcheta)) + (cons 'srcheta info-searcheta) + (cons 'srchmode (cdr (assoc 'search-mode session)))) op) (newline op) (close-port op)))) @@ -325,6 +326,9 @@ ) (define (handlesr filename fnet peer size slots resptime hash) + (if (eq? (cdr (assoc 'search-mode session)) 'wait) + (begin (set-cdr! (assoc 'search-mode session) 'normal) + (logf "reverting to normal mode"))) (let ((cl (or (assoc size sr) (let ((newp (cons size '()))) (set! sr (append sr (list newp))) newp))) (newsr (list @@ -377,7 +381,7 @@ (define (autodl-main args) (let ((dc-server #f) (done #f) (retval 0)) - (let ((getopt (make-getopt (cdr args) "hs:S:e:p:t:a:I:")) (arg #f)) + (let ((getopt (make-getopt (cdr args) "whs:S:e:p:t:a:I:")) (arg #f)) (do ((arg (getopt) (getopt))) ((not (and (pair? arg) (char? (car arg)))) (set! args arg)) (cond ((eq? (car arg) #\h) (begin (display "usage: autodl [-s server] -S sessfile\n" (current-error-port)) @@ -418,7 +422,7 @@ (if (not (assoc 'maxtrans session)) (set! session (cons '(maxtrans . 1) session))) (if (not (assoc 'search-mode session)) - (set! session (cons '(search-mode . wait) session))) + (set! session (cons '(search-mode . normal) session))) (if (not (validate-session session)) (begin (display "Invalid session!\n" (current-error-port)) (exit 1))) (if (not dc-server) (set! dc-server (getenv "DCSERVER"))) (if (not dc-server) (set! dc-server "localhost")) @@ -428,7 +432,7 @@ (lambda (key . args) (logf (string-append "could not connect to server: " (apply format #f (cadr args) (caddr args)))) (exit 2))) - (dc-ecmd-assert 200 "notify" "all" "on") + (dc-ecmd-assert 200 "notify" "trans:act" "on" "trans:prog" "on" "srch:act" "on") (for-each (lambda (sig) (sigaction sig (lambda (sig) (throw 'sig sig)))) (list SIGINT SIGTERM SIGHUP)) (catch 'sig (lambda ()