mirror of
https://github.com/janet-lang/janet
synced 2025-07-07 12:32:55 +00:00
Don't bind when address info doesn't exist
Simple logic issue, something overlooked.
This commit is contained in:
parent
1ce2361daf
commit
2a4bcc262f
@ -429,6 +429,7 @@ JANET_CORE_FN(cfun_net_connect,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ai != NULL) {
|
||||||
/* Check all addrinfos in a loop for the first that we can bind to. */
|
/* Check all addrinfos in a loop for the first that we can bind to. */
|
||||||
struct addrinfo *rp = NULL;
|
struct addrinfo *rp = NULL;
|
||||||
for (rp = ai; rp != NULL; rp = rp->ai_next) {
|
for (rp = ai; rp != NULL; rp = rp->ai_next) {
|
||||||
@ -447,6 +448,7 @@ JANET_CORE_FN(cfun_net_connect,
|
|||||||
if (NULL == rp) {
|
if (NULL == rp) {
|
||||||
janet_panic("could not bind outgoing address");
|
janet_panic("could not bind outgoing address");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Connect to socket */
|
/* Connect to socket */
|
||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user