summaryrefslogtreecommitdiff
path: root/fibers
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-02-14 22:04:56 +0100
committerAndy Wingo <wingo@pobox.com>2017-02-14 22:04:56 +0100
commit0e729aca121b0dedd2565df62d35bc24d584aed3 (patch)
tree0b6eb8b1dcb9350927b1f764ce7778b23f53af70 /fibers
parentGracefully handle EPIPE (diff)
downloadguile-fibers-0e729aca121b0dedd2565df62d35bc24d584aed3.tar.gz
Minor tweak to web server
* fibers/web/server.scm (socket-loop): Move set-nonblocking! call to client where it parallelizes better.
Diffstat (limited to 'fibers')
-rw-r--r--fibers/web/server.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/fibers/web/server.scm b/fibers/web/server.scm
index e2f6dab..dbca90d 100644
--- a/fibers/web/server.scm
+++ b/fibers/web/server.scm
@@ -217,13 +217,14 @@ on the procedure being called at any particular time."
((client . sockaddr)
;; From "HOP, A Fast Server for the Diffuse Web", Serrano.
(setsockopt client SOL_SOCKET SO_SNDBUF (* 12 1024))
- (set-nonblocking! client)
;; Always disable Nagle's algorithm, as we handle buffering
;; ourselves. Ignore exceptions if it's not a TCP port, or
;; TCP_NODELAY is not defined on this platform.
(false-if-exception
(setsockopt client IPPROTO_TCP TCP_NODELAY 0))
- (spawn-fiber (lambda () (client-loop client handler))
+ (spawn-fiber (lambda ()
+ (set-nonblocking! client)
+ (client-loop client handler))
#:parallel? #t)
(loop)))))