diff --git a/imperative/drivers/web.rkt b/imperative/drivers/web.rkt index 17cb9b5..19e5b6b 100644 --- a/imperative/drivers/web.rkt +++ b/imperative/drivers/web.rkt @@ -275,7 +275,8 @@ (list))) (output-response/method conn resp - (request-method req))))) + (request-method req)) + (drain-ws-ch! ws-ch)))) ((make-general-websockets-dispatcher (websocket-connection-main id ws-ch) (lambda _args (values reply-headers (void)))) @@ -317,9 +318,11 @@ (loop)])))) (ws-close! wsc)) (when (not quit-seen?) - (let loop () - (when (not (equal? (channel-get ws-ch) 'quit)) - (loop))))) + (drain-ws-ch! ws-ch))) + +(define (drain-ws-ch! ws-ch) + (when (not (equal? (channel-get ws-ch) 'quit)) + (drain-ws-ch! ws-ch))) ;; D-: uck barf ;; TODO: something to fix this :-/