Avoid double-fin (!).

This commit is contained in:
Tony Garnock-Jones 2016-01-27 21:46:20 -05:00
parent a86eb10494
commit 38e3c9de0f
1 changed files with 6 additions and 3 deletions

View File

@ -536,10 +536,13 @@
;; ConnState -> Transition
(define (close-outbound-stream s)
(define b (conn-state-outbound s))
(transition
(struct-copy conn-state s
[outbound (struct-copy buffer (buffer-push (conn-state-outbound s) #"!") ;; dummy FIN byte
[finished? #t])])
(if (buffer-finished? b)
s
(struct-copy conn-state s
[outbound (struct-copy buffer (buffer-push b #"!") ;; dummy FIN byte
[finished? #t])]))
'()))
(define (state-vector-behavior e s)