Fix bug with outbound websocket connections

This commit is contained in:
Tony Garnock-Jones 2016-05-12 10:44:27 -04:00
parent 8d6bc484a8
commit 4de4a099b9
1 changed files with 4 additions and 4 deletions

View File

@ -129,10 +129,10 @@
(spawn (lambda (e buffered-messages-rev)
(match e
[(message (at-meta (websocket-connection _ _ _ c _)))
(when (not (exn? c))
(for [(m (reverse buffered-messages-rev))] (ws-send! c m))
(spawn-connection local-addr remote-addr id c control-ch))
(quit)]
(quit
(when (not (exn? c))
(for [(m (reverse buffered-messages-rev))] (ws-send! c m))
(spawn-connection local-addr remote-addr id c control-ch)))]
[(message (websocket-message _ _ m))
(transition (cons m buffered-messages-rev) '())]
[_ #f]))