diff --git a/knots/web-server.scm b/knots/web-server.scm index c5ec246..75ccd09 100644 --- a/knots/web-server.scm +++ b/knots/web-server.scm @@ -299,11 +299,12 @@ on the procedure being called at any particular time." (define* (client-loop client handler exception-handler write-response-exception-handler - connection-idle-timeout) + connection-idle-timeout + buffer-size) ;; Always disable Nagle's algorithm, as we handle buffering ;; ourselves; when we force-output, we really want the data to go ;; out. - (setvbuf client 'block 1024) + (setvbuf client 'block buffer-size) (setsockopt client IPPROTO_TCP TCP_NODELAY 1) (with-throw-handler #t (lambda () @@ -352,7 +353,8 @@ on the procedure being called at any particular time." default-exception-handler) (write-response-exception-handler default-write-response-exception-handler) - (connection-idle-timeout 60)) + (connection-idle-timeout 60) + (connection-buffer-size 1024)) "Run the knots web server. HANDLER should be a procedure that takes one argument, the HTTP @@ -387,7 +389,8 @@ before sending back to the client." (client-loop client handler exception-handler write-response-exception-handler - connection-idle-timeout)) + connection-idle-timeout + connection-buffer-size)) #:parallel? #t) (loop))))))