disconnect politely if there are no active assignments
svn: r1076
This commit is contained in:
parent
988dfce4ae
commit
c47b962567
|
@ -238,6 +238,7 @@
|
||||||
(let* ([h (connect)]
|
(let* ([h (connect)]
|
||||||
[l (retrieve-active-assignments h)])
|
[l (retrieve-active-assignments h)])
|
||||||
(when (null? l)
|
(when (null? l)
|
||||||
|
(handin-disconnect h)
|
||||||
(error 'handin "there are no active assignments"))
|
(error 'handin "there are no active assignments"))
|
||||||
(set! connection h)
|
(set! connection h)
|
||||||
(for-each (lambda (assign) (send assignment append assign))
|
(for-each (lambda (assign) (send assignment append assign))
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
(require (lib "mzssl.ss" "openssl"))
|
(require (lib "mzssl.ss" "openssl"))
|
||||||
|
|
||||||
(provide handin-connect
|
(provide handin-connect
|
||||||
|
handin-disconnect
|
||||||
retrieve-extra-fields
|
retrieve-extra-fields
|
||||||
retrieve-active-assignments
|
retrieve-active-assignments
|
||||||
submit-assignment
|
submit-assignment
|
||||||
|
@ -42,6 +43,10 @@
|
||||||
;; Return connection:
|
;; Return connection:
|
||||||
(make-handin r w))))
|
(make-handin r w))))
|
||||||
|
|
||||||
|
(define (handin-disconnect h)
|
||||||
|
(write+flush (handin-w h) 'bye)
|
||||||
|
(close-handin-ports h))
|
||||||
|
|
||||||
(define (retrieve-extra-fields h)
|
(define (retrieve-extra-fields h)
|
||||||
(let ([r (handin-r h)] [w (handin-w h)])
|
(let ([r (handin-r h)] [w (handin-w h)])
|
||||||
(write+flush w 'get-extra-fields 'bye)
|
(write+flush w 'get-extra-fields 'bye)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user