Changeset 8431 in project


Ignore:
Timestamp:
02/13/08 05:33:08 (11 years ago)
Author:
elf
Message:

finished the fix, and fixed a dangled paren. my fault.

Location:
release/3/http/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/3/http/trunk/http-client.scm

    r8427 r8431  
    209209                   (set! result (string-append method " " path " " proto
    210210                                           "\r\nHost: " host ":"
    211                                            (->string port) "\r\n") o)))
     211                                           (->string port) "\r\n")))
    212212             (for-each
    213213              (lambda (a)
     
    218218                 (set! result (sprintf "~AContent-Length: 0\r\n\r\n" result) ))
    219219             (display result o)
    220              (flush-output o)
     220             (flush-output o))
    221221             (let* ([header (read-line i (http:read-line-limit))]
    222222                    [a (http:read-request-attributes i)])
  • release/3/http/trunk/http-server.scm

    r6863 r8431  
    323323  (if (eq? 'HTTP/1.0 (http:request-protocol req))
    324324      ;; Default for 1.0 is to close unless explicitly asked to keep alive
     325      (sprintf "Connection: ~A\r\n"
    325326      (if (string-ci=? "keep-alive"
    326327                       (alist-ref "connection" (http:request-attributes req) string-ci=? ""))
    327           (fprintf port "Connection: Keep-alive\r\n")
    328           (fprintf port "Connection: Close\r\n"))
     328          "Keep-alive"
     329          "Close"))
     330          ;(fprintf port "Connection: Keep-alive\r\n")
     331          ;(fprintf port "Connection: Close\r\n"))
    329332      ;; For 1.1 default is to keep alive unless explicitly asked to close
    330333      (if (string-ci=? "close"
    331334                       (alist-ref "connection" (http:request-attributes req) string-ci=? ""))
    332           (fprintf port "Connection: Close\r\n"))))
     335           "Connection: Close\r\n")))
     336          ;(fprintf port "Connection: Close\r\n"))))
    333337
    334338(define (http:write-response-header req #!optional [code 200] [msg "OK"] [alist '()]
    335339                                    [port (current-output-port)]
    336340                                    [protocol current-server-protocol])
    337   (let ((prot (protocol->string protocol))) ; XXX What happens when request and response protocols don't match?
     341  (let* ((prot (protocol->string protocol)) ; XXX What happens when request and response protocols don't match?
     342         (result (sprintf "~A ~A ~A\r\nServer: ~A\r\n" prot code msg (default-property "Server" current-server-name alist))))
    338343    (dribble "Response: ~a ~a ~a" prot code msg)
    339     (fprintf port "~A ~A ~A\r\nServer: ~A\r\n"
    340              prot
    341              code msg
    342              (default-property "Server" current-server-name alist) )
    343     (output-connection-mode port req)
     344    ;(fprintf port "~A ~A ~A\r\nServer: ~A\r\n"
     345;            prot
     346;            code msg
     347;            (default-property "Server" current-server-name alist) )
     348    (set! result (sprintf "~A~A" result (output-connection-mode port req)))
    344349    (for-each
    345350     (lambda (h)
    346351       (let ([hd (car h)])
    347352         (unless (or (string-ci=? "Server" hd) (string-ci=? "Connection" hd))
    348            (fprintf port "~A: ~A\r\n" hd (cdr h)))))
     353           (set! result (sprintf "~A~A: ~A\r\n" result hd (cdr h))))))
     354           ;(fprintf port "~A: ~A\r\n" hd (cdr h)))))
    349355     alist)
    350     (fprintf port "\r\n")))
     356    (fprintf port "~A\r\n" result)))
     357    ;(fprintf port "\r\n")))
    351358
    352359(define (default-property name def props)
Note: See TracChangeset for help on using the changeset viewer.