Check-in [f5e9b53cb5]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:use transcoded-port in handle-scgi-connection
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f5e9b53cb5de8fca0413577fe5ef4be9226a71ad
User & Date: aldo 2016-12-13 15:41:49
Context
2016-12-13
23:24
added free-gettext check-in: 69b77102c5 user: aldo tags: trunk
15:41
use transcoded-port in handle-scgi-connection check-in: f5e9b53cb5 user: aldo tags: trunk
00:11
added sxml-match doc check-in: 31ed97375e user: aldo tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to scgi.sls.

    58     58     
    59     59     (define (handle-scgi-connection sock)
    60     60       (define h (read-headers sock))
    61     61       (assert (string=? "1" (cdr (assq 'SCGI h))))
    62     62       (let* ([len (string->number (cdr (assq 'CONTENT_LENGTH h)))]
    63     63   	   [content (get-bytevector-n sock len)])
    64     64         (assert (= (bytevector-length content) len))
    65         -      (let ([port (open-fd-output-port
    66         -		   (port-file-descriptor sock)
    67         -		   'block
    68         -		   (make-transcoder (utf-8-codec) 'none))])
           65  +      (let ([port (transcoded-port sock (make-transcoder (utf-8-codec) 'none))])
    69     66   	((scgi-request-handler) port h content)
    70     67   	(flush-output-port port))))
    71     68   
    72     69     (define (run-scgi addr port)
    73     70       (define nchildren 0)
    74     71       (define max-children 10)
    75     72       (define waitpid (foreign-procedure "waitpid" (int void* int) int))
    76     73       (call-with-port
    77     74        (socket 'inet 'stream '() 0)
    78         -     (lambda (sock)	
           75  +     (lambda (sock)
    79     76          (bind/inet sock addr port)
    80     77          (listen sock 1000)
    81     78          (do ()
    82     79   	   (#f)
    83     80   	 (printf "scgi: waiting for connection...~n")
    84     81   	 (call-with-port
    85     82   	  (accept sock)