1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

web: Pass `AI_NUMERICSERV' when given a port number.

* module/web/client.scm (open-socket-for-uri)[addresses]: Pass
  AI_NUMERICSERV as the `getaddrinfo' hint when (uri-port URI) is true.
This commit is contained in:
Ludovic Courtès 2012-10-12 23:09:44 +02:00
parent 2663411bd7
commit d74fcce9b9

View file

@ -44,10 +44,13 @@
(define (open-socket-for-uri uri)
"Return an open input/output port for a connection to URI."
(define addresses
(getaddrinfo (uri-host uri)
(cond
((uri-port uri) => number->string)
(else (symbol->string (uri-scheme uri))))))
(let ((port (uri-port uri)))
(getaddrinfo (uri-host uri)
(cond (port => number->string)
(else (symbol->string (uri-scheme uri))))
(if port
AI_NUMERICSERV
0))))
(let loop ((addresses addresses))
(let* ((ai (car addresses))