[plt-scheme] Buffering problems with web-server and HTTP/1.1

From: Edmund Dengler (edmundd at eSentire.com)
Date: Sat May 21 22:07:52 EDT 2005


Using the current CVS tree, I am having problems with the web server
buffering output under HTTP/1.1 requests, so a browser does not get a

I found a fast fix by specifying no buffering on the output port within

      (define (server-loop get-ports)
        (let loop ()
          (let ([connection-cust (make-custodian)])
            (parameterize ([current-custodian connection-cust])
              (let-values ([(ip op) (get-ports)])
                (file-stream-buffer-mode op 'none) ;; FIX
                 (lambda ()
                    (new-connection config:initial-connection-timeout
                                    ip op (current-custodian) #f))))))

(Note: This problem does not occur under 299.100)

Can anyone let me know if this is a resonable fix, or if there is a better


Posted on the users mailing list.