mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +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:
parent
2663411bd7
commit
d74fcce9b9
1 changed files with 7 additions and 4 deletions
|
@ -44,10 +44,13 @@
|
||||||
(define (open-socket-for-uri uri)
|
(define (open-socket-for-uri uri)
|
||||||
"Return an open input/output port for a connection to URI."
|
"Return an open input/output port for a connection to URI."
|
||||||
(define addresses
|
(define addresses
|
||||||
(getaddrinfo (uri-host uri)
|
(let ((port (uri-port uri)))
|
||||||
(cond
|
(getaddrinfo (uri-host uri)
|
||||||
((uri-port uri) => number->string)
|
(cond (port => number->string)
|
||||||
(else (symbol->string (uri-scheme uri))))))
|
(else (symbol->string (uri-scheme uri))))
|
||||||
|
(if port
|
||||||
|
AI_NUMERICSERV
|
||||||
|
0))))
|
||||||
|
|
||||||
(let loop ((addresses addresses))
|
(let loop ((addresses addresses))
|
||||||
(let* ((ai (car addresses))
|
(let* ((ai (car addresses))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue