Fixes PR11024.
The problem was that when the connection is closed its custodian is shutdown, thus killing the thread that was going to bring the server down. The difference between curl and the browser was that even though they both use HTTP/1.1, the browser actually leaves the connection open longer.
This commit is contained in:
parent
334978a8e4
commit
80b6ceeff1
|
@ -130,5 +130,7 @@
|
|||
(shutdown-server))])
|
||||
(with-handlers ([exn:break? (lambda (exn) (bye))])
|
||||
(semaphore-wait/enable-break sema)
|
||||
; Give the final response time to get there
|
||||
(sleep 2)
|
||||
;; We can get here if a /quit url is visited
|
||||
(bye))))
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
(define (quit-server sema)
|
||||
(lift:make
|
||||
(lambda (request)
|
||||
(thread (lambda () (sleep 2) (semaphore-post sema)))
|
||||
(semaphore-post sema)
|
||||
`(html (head (title "Server Stopped")
|
||||
(link ([rel "stylesheet"] [href "/error.css"])))
|
||||
(body (div ([class "section"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user