Be less gratuitously noisy on socket close.

This commit is contained in:
Tony Garnock-Jones 2011-10-26 19:14:45 -04:00
parent c42934d07b
commit 3d0d2c38e9
1 changed files with 12 additions and 5 deletions

View File

@ -769,10 +769,13 @@
((arrived _) ((arrived _)
conn) conn)
((and departure (departed who why)) ((and departure (departed who why))
(disconnect-with-error/local-info (if (zero? (hash-count (connection-channel-map conn)))
departure ;; No open or half-open channels. No point in complaining; just leave.
SSH_DISCONNECT_CONNECTION_LOST #f
"I/O error")) ;; At least one channel. Make more of a noise.
(disconnect-with-error/local-info departure
SSH_DISCONNECT_CONNECTION_LOST
"I/O error")))
((says _ amount 'output-byte-count) ((says _ amount 'output-byte-count)
;; writer reporting bytes transferred ;; writer reporting bytes transferred
(bump-total amount conn)) (bump-total amount conn))
@ -854,7 +857,11 @@
(handle-evt (send (connection-session-room-handle conn) listen-evt) (handle-evt (send (connection-session-room-handle conn) listen-evt)
session-room-message-handler) session-room-message-handler)
(channel-events conn)))) (channel-events conn))))
(loop (handler conn))))))) (define new-conn (handler conn))
;; The handler is permitted to return #f to indicate that the session is to be
;; gracefully shut down.
(when new-conn
(loop new-conn)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Session choreography ;; Session choreography