Ticket #1210: http-client-changes.diff
File http-client-changes.diff, 1.5 KB (added by , 8 years ago) |
---|
-
http-client.scm
183 182 (define ssl-connect 184 183 (dynamic-import 'openssl 'ssl-connect (lambda (h p) (values #f #f)))) 185 184 186 (define (ensure-connection! uri )185 (define (ensure-connection! uri conn-factory) 187 186 (or (get-connection uri) 188 187 (let* ((proxy ((determine-proxy) uri)) 189 188 (remote-end (or proxy uri))) 190 189 (receive (in out) 191 190 (case (uri-scheme remote-end) 192 ((#f http) ( tcp-connect(uri-host remote-end) (uri-port remote-end)))191 ((#f http) ((or conn-factory tcp-connect) (uri-host remote-end) (uri-port remote-end))) 193 192 ((https) (receive (in out) 194 ( ssl-connect(uri-host remote-end)193 ((or conn-factory ssl-connect) (uri-host remote-end) 195 194 (uri-port remote-end)) 196 195 (if (and in out) ; Ugly, but necessary 197 196 (values in out) … … 510 509 (redirects 0) 511 510 (req req)) 512 511 (condition-case 513 (let* ((con (ensure-connection! (request-uri req) ))512 (let* ((con (ensure-connection! (request-uri req) (request-conn-factory req))) 514 513 (req (add-headers (update-request 515 514 req port: (http-connection-outport con)))) 516 515 ;; No outgoing URIs should ever contain credentials or fragments