diff --git a/scheme/httpd/surflets/surflet-handler.scm b/scheme/httpd/surflets/surflet-handler.scm index c9d4105..3679603 100644 --- a/scheme/httpd/surflets/surflet-handler.scm +++ b/scheme/httpd/surflets/surflet-handler.scm @@ -252,13 +252,13 @@ (define (send/finish response) (delete-session! (instance-session-id)) - (shift unused response)) + (shift unused (make-surflet-response response))) (define (send response) - (shift unsused response)) + (shift unused (make-surflet-response response))) (define (make-surflet-response response) - (let ((surflet-out-port (open-output-string)) + (let ((buffer (open-output-string)) (surflet-in-port #f) ;; FIXME: no input-port available (options #f)) ;; FIXME: No access to httpd-options :-( (if (writer-body? (response-body response)) @@ -266,7 +266,7 @@ ;; Error-handler is already installed. ;; Force string-output to resolve all send/... calls. (display-http-body (response-body response) - surflet-in-port surflet-out-port + surflet-in-port buffer options) ;; Create write-out-response for webserver. (make-response @@ -277,7 +277,7 @@ (response-extras response) (make-writer-body (lambda (out options) - (display (get-output-string surflet-out-port) out))))) + (display (get-output-string buffer) out))))) (make-error-response (status-code bad-gateway) #f "The surflet returned an invalid response object (no writer-body)."))))