Fix handling of client-loop exceptions
Maybe other things can go wrong here, so log so that there's some information available.
This commit is contained in:
parent
d597b77fcb
commit
ca3d5a1781
1 changed files with 14 additions and 2 deletions
|
@ -338,7 +338,18 @@ on the procedure being called at any particular time."
|
||||||
(let loop ()
|
(let loop ()
|
||||||
(cond
|
(cond
|
||||||
((with-exception-handler
|
((with-exception-handler
|
||||||
(lambda _ #t)
|
(lambda (exn)
|
||||||
|
(unless (and (exception-with-origin? exn)
|
||||||
|
(string=? (exception-origin exn)
|
||||||
|
"fport_write"))
|
||||||
|
(display "knots web-server, exception in client loop:\n"
|
||||||
|
(current-error-port))
|
||||||
|
(print-exception
|
||||||
|
(current-error-port)
|
||||||
|
#f
|
||||||
|
'%exception
|
||||||
|
(list exn)))
|
||||||
|
#t)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(or
|
(or
|
||||||
(if (eq? #f connection-idle-timeout)
|
(if (eq? #f connection-idle-timeout)
|
||||||
|
@ -350,7 +361,8 @@ on the procedure being called at any particular time."
|
||||||
(wrap-operation
|
(wrap-operation
|
||||||
(sleep-operation connection-idle-timeout)
|
(sleep-operation connection-idle-timeout)
|
||||||
(const #t)))))
|
(const #t)))))
|
||||||
(eof-object? (lookahead-u8 client)))))
|
(eof-object? (lookahead-u8 client))))
|
||||||
|
#:unwind? #t)
|
||||||
(close-port client))
|
(close-port client))
|
||||||
(else
|
(else
|
||||||
(let ((keep-alive? (handle-request handler client
|
(let ((keep-alive? (handle-request handler client
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue