Adding some debugging notes
This commit is contained in:
parent
86b0595795
commit
270581377b
|
@ -56,7 +56,6 @@
|
|||
#:responders-servlet-loading [responders-servlet-loading servlet-loading-responder]
|
||||
#:responders-servlet [responders-servlet servlet-error-responder])
|
||||
(lambda (conn req)
|
||||
(define uri (request-uri req))
|
||||
(define instance-custodian (make-servlet-custodian))
|
||||
(parameterize ([current-custodian instance-custodian]
|
||||
[current-execution-context (make-execution-context req)]
|
||||
|
@ -64,13 +63,21 @@
|
|||
(lambda (r)
|
||||
(kill-connection! conn)
|
||||
(custodian-shutdown-all instance-custodian))])
|
||||
(define uri (request-uri req))
|
||||
(define maybe-response
|
||||
(with-handlers ([exn:fail:filesystem:exists?
|
||||
(lambda (the-exn) (next-dispatcher))]
|
||||
[exn:dispatcher? raise]
|
||||
[(lambda (x) #t)
|
||||
(lambda (the-exn) (responders-servlet-loading uri the-exn))])
|
||||
(lambda (the-exn)
|
||||
(responders-servlet-loading uri the-exn))])
|
||||
;; This could cause the servlet to be initialized, so we
|
||||
;; need to make sure that if it errors, the right kind of
|
||||
;; error will happen.
|
||||
(define the-servlet (url->servlet uri))
|
||||
;; If it didn't cause initialization, then we need to switch
|
||||
;; to the custodian that it started with, among other
|
||||
;; things, including throwing a different kind of error
|
||||
(parameterize ([current-servlet the-servlet]
|
||||
[current-custodian (servlet-custodian the-servlet)]
|
||||
[current-directory (servlet-directory the-servlet)]
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
(define (new-connection time-to-live i-port o-port cust close?)
|
||||
(define conn
|
||||
(make-connection
|
||||
(begin0 (unbox i) (set-box! i (add1 (unbox i))))
|
||||
;; The id is just for debugging and isn't normally useful
|
||||
0 ;; (begin0 (unbox i) (set-box! i (add1 (unbox i))))
|
||||
#f i-port o-port cust close?))
|
||||
(define conn-wb (make-weak-box conn))
|
||||
(set-connection-timer!
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
racket/async-channel
|
||||
racket/port
|
||||
mzlib/thread)
|
||||
(require racket/format)
|
||||
(require "web-server-structs.rkt"
|
||||
"connection-manager.rkt"
|
||||
"dispatch-server-sig.rkt")
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
(thread
|
||||
(lambda ()
|
||||
(let loop ([timers null])
|
||||
#;(printf "Timers: ~a\n" (length timers))
|
||||
;; (printf "Timers: ~a\n" (length timers))
|
||||
;; Wait for either...
|
||||
(apply sync
|
||||
;; ... a timer-request message ...
|
||||
|
|
Loading…
Reference in New Issue
Block a user