diff --git a/collects/web-server/connection-manager.ss b/collects/web-server/connection-manager.ss index ded464b81b..6255d384db 100644 --- a/collects/web-server/connection-manager.ss +++ b/collects/web-server/connection-manager.ss @@ -33,6 +33,7 @@ ;; kill-connection!: connection -> void ;; kill this connection (define (kill-connection! conn-demned) + (cancel-timer! (connection-timer conn-demned)) (close-output-port (connection-o-port conn-demned)) (close-input-port (connection-i-port conn-demned)) (set-connection-close?! conn-demned #t) diff --git a/collects/web-server/servlet.ss b/collects/web-server/servlet.ss index ccd5c7c01d..dcc2e0ef63 100644 --- a/collects/web-server/servlet.ss +++ b/collects/web-server/servlet.ss @@ -20,6 +20,7 @@ [send/suspend/callback (xexpr/callback? . -> . any)]) (provide + clear-continuation-table! send/suspend/dispatch current-servlet-continuation-expiration-handler (all-from "servlet-helpers.ss") @@ -45,6 +46,10 @@ (reset-timer (servlet-instance-timer (get-current-servlet-instance)) secs)) + ;; ext:clear-continuations! -> void + (define (clear-continuation-table!) + (clear-continuations! (get-current-servlet-instance))) + ;; send/back: response -> void ;; send a response and don't clear the continuation table (define (send/back resp) @@ -55,7 +60,7 @@ ;; send/finish: response -> void ;; send a response and clear the continuation table (define (send/finish resp) - (clear-continuations! (get-current-servlet-instance)) + (clear-continuation-table!) ; If we readjust the timeout to something small, the session will expire shortly ; we cannot wait for send/back to return, because it doesn't ; Also, we cannot get the initial-connection-timeout variable from here @@ -82,7 +87,7 @@ ;; clear the continuation table, then behave like send/suspend (define send/forward (opt-lambda (response-generator [expiration-handler (current-servlet-continuation-expiration-handler)]) - (clear-continuations! (get-current-servlet-instance)) + (clear-continuation-table!) (send/suspend response-generator expiration-handler))) ;; send/suspend/callback : xexpr/callback? -> void diff --git a/collects/web-server/timer.ss b/collects/web-server/timer.ss index d2a16b3554..afe5f9b0da 100644 --- a/collects/web-server/timer.ss +++ b/collects/web-server/timer.ss @@ -3,6 +3,7 @@ (require (lib "list.ss")) (provide timer? start-timer reset-timer increment-timer + cancel-timer! start-timer-manager) (define timer-ch (make-channel))