From 742b6682ea80160a61096b1e27d374b3b57c4219 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Mon, 22 Aug 2005 17:08:14 +0000 Subject: [PATCH] Fixing sync bug svn: r633 --- collects/web-server/connection-manager.ss | 5 +---- collects/web-server/response.ss | 26 +++++++++++------------ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/collects/web-server/connection-manager.ss b/collects/web-server/connection-manager.ss index 09bfef016f..01d7a08ef5 100644 --- a/collects/web-server/connection-manager.ss +++ b/collects/web-server/connection-manager.ss @@ -51,8 +51,5 @@ ;; adjust-connection-timeout!: connection number -> void ;; change the expiration time for this connection (define (adjust-connection-timeout! conn time) - (call-with-semaphore - (connection-mutex conn) - (lambda () - (reset-timer (connection-timer conn) time)))) + (reset-timer (connection-timer conn) time)) ) diff --git a/collects/web-server/response.ss b/collects/web-server/response.ss index 88e18aaaab..3625f237d9 100644 --- a/collects/web-server/response.ss +++ b/collects/web-server/response.ss @@ -77,19 +77,7 @@ [rename ext:output-response output-response (connection? any/c . -> . any)] [rename ext:output-response/method output-response/method (connection? response? symbol? . -> . any)] [rename ext:output-file output-file (connection? path? symbol? bytes? . -> . any)] - [TEXT/HTML-MIME-TYPE bytes?] - ) - - - (define (ext:output-response conn resp) - (call-with-semaphore (connection-mutex conn) - (lambda () (output-response conn resp)))) - (define (ext:output-response/method conn resp meth) - (call-with-semaphore (connection-mutex conn) - (lambda () (output-response/method conn resp meth)))) - (define (ext:output-file conn file-path method mime-type) - (call-with-semaphore (connection-mutex conn) - (lambda () (output-file conn file-path method mime-type)))) + [TEXT/HTML-MIME-TYPE bytes?]) ;; Table 1. head responses: ; ------------------------------------------------------------------------------ @@ -186,6 +174,10 @@ ;; ************************************************** ;; output-response: connection response -> void + (define (ext:output-response conn resp) + (call-with-semaphore (connection-mutex conn) + (lambda () (output-response conn resp)))) + (define (output-response conn resp) (cond [(response/full? resp) @@ -247,6 +239,10 @@ ;; ************************************************** ;; output-file: connection path symbol bytes -> void + (define (ext:output-file conn file-path method mime-type) + (call-with-semaphore (connection-mutex conn) + (lambda () (output-file conn file-path method mime-type)))) + (define (output-file conn file-path method mime-type) (output-headers conn 200 "Okay" `(("Content-length: " ,(file-size file-path))) @@ -261,6 +257,10 @@ ;; ************************************************** ;; output-response/method: connection response/full symbol -> void ;; If it is a head request output headers only, otherwise output as usual + (define (ext:output-response/method conn resp meth) + (call-with-semaphore (connection-mutex conn) + (lambda () (output-response/method conn resp meth)))) + (define (output-response/method conn resp meth) (cond [(eqv? meth 'head)