From 7f81f8bed9f5194e0e4665ecb4c1237b3b51cf31 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Wed, 26 Feb 2003 18:03:40 +0000 Subject: [PATCH] + Use a port buffer of 4096 bytes for the socket's output port. + Comment why we cannot do the same for input. --- scheme/httpd/core.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scheme/httpd/core.scm b/scheme/httpd/core.scm index a4d149f..d32a502 100644 --- a/scheme/httpd/core.scm +++ b/scheme/httpd/core.scm @@ -47,9 +47,6 @@ (cond ((httpd-options-post-bind-thunk options) => (lambda (thunk) (thunk))))) - ;; Why is the output socket unbuffered? So that if the client - ;; closes the connection, we won't lose when we try to close the - ;; socket by trying to flush the output buffer. (lambda (sock addr) (if rate-limiter (begin @@ -71,9 +68,11 @@ (format-internet-host-address host-address) (rate-limiter-current-requests rate-limiter))) - (set-port-buffering (socket:outport sock) bufpol/none) ; No buffering + (set-port-buffering (socket:outport sock) bufpol/block 4096) (fork-thread - (lambda () + (lambda () + ;; If there is buffering for the input, + ;; CGI scripts don't get the full request (set-port-buffering (socket:inport sock) bufpol/none) (process-toplevel-request sock host-address options) (if (http-syslog?)