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:
parent
2663411bd7
commit
d74fcce9b9
1 changed files with 7 additions and 4 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue