Skip to content

Commit

Permalink
Force output pouring
Browse files Browse the repository at this point in the history
  • Loading branch information
borodust committed Apr 18, 2017
1 parent 232f276 commit 1ad1d04
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions proxy/proxy.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@
(when (listen source-stream)
;; no need to do full copy, hence no loop: let server do other work in between
(let ((bytes-read (read-sequence routing-buffer source-stream)))
(write-sequence routing-buffer destination-stream :end bytes-read)))))))
(write-sequence routing-buffer destination-stream :end bytes-read)
(force-output destination-stream)))))))


(defun route-stream ()
(let* ((arena (find-arena-by-peer (arena-registry-of *system*) *peer*))
(arena-server (server-of arena)))
(if (eq arena-server *peer*)
(loop for client in (clients-of arena)
do (pour-stream arena-server client))
(pour-stream *peer* arena-server))))
(when-let ((arena (find-arena-by-peer (arena-registry-of *system*) *peer*)))
(let ((arena-server (server-of arena)))
(if (eq arena-server *peer*)
(loop for client in (clients-of arena)
do (pour-stream arena-server client))
(pour-stream *peer* arena-server)))))


(defun process-input ()
Expand Down

0 comments on commit 1ad1d04

Please sign in to comment.