1
0
Fork 0

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 (!).
This commit is contained in:
Andy Wingo 2010-12-06 20:01:43 +01:00
parent 68966d9e17
commit 98cac18528

View file

@ -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))))