From 98cac185284dea42a31ab412f15017939d7a48eb Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 6 Dec 2010 20:01:43 +0100 Subject: [PATCH] mod-lisp calls setvbuf only once * tekuti/mod-lisp.scm (mod-lisp-read): Like the http impl, just setvbuf once, and don't throw away data (!). --- tekuti/mod-lisp.scm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tekuti/mod-lisp.scm b/tekuti/mod-lisp.scm index b16dab7..59002b7 100644 --- a/tekuti/mod-lisp.scm +++ b/tekuti/mod-lisp.scm @@ -219,8 +219,8 @@ ;; ;; FIXME: preserve meta-info. (let ((client (accept (poll-set-port poll-set idx)))) - ;; Set line buffering while reading the request. - (setvbuf (car client) _IOLBF) + ;; Fully buffered. + (setvbuf (car client) _IOFBF) ;; From "HOP, A Fast Server for the Diffuse Web", Serrano. (setsockopt (car client) SOL_SOCKET SO_SNDBUF (* 12 1024)) (poll-set-add! poll-set (car client) *events*) @@ -246,8 +246,6 @@ #t (lambda () (let ((req (read-request/mod-lisp port))) - ;; Block buffering for reading body and writing response. - (setvbuf port _IOFBF) (values port req (read-request-body/latin-1 req))))