1
0
Fork 0

robustness in mod-lisp-read

* tekuti/mod-lisp.scm (mod-lisp-read): Close the port if there is an
  error reading the request.
This commit is contained in:
Andy Wingo 2010-12-06 11:37:47 +01:00
parent fc386dcb71
commit 15f024a12d

View file

@ -242,12 +242,17 @@
;; Otherwise, try to read a request from this port.
;; Record the next index.
(set-mod-lisp-poll-idx! server (1- idx))
(with-throw-handler
#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))))))))))))
(read-request-body/latin-1 req))))
(lambda (k . args)
(false-if-exception (close-port port)))))))))))))
;; -> unspecified values
(define (mod-lisp-write server client response body)