Fix. setsockname fails with "*" as host.
Add. test_bind.lua
This commit is contained in:
parent
56dbda39ed
commit
e54f78c61c
3 changed files with 9 additions and 1 deletions
|
@ -478,6 +478,9 @@ const char *inet_trybind(p_socket ps, const char *address, const char *serv,
|
|||
struct addrinfo *iterator = NULL, *resolved = NULL;
|
||||
const char *err = NULL;
|
||||
t_socket sock = *ps;
|
||||
/* translate luasocket special values to C */
|
||||
if (strcmp(address, "*") == 0) address = NULL;
|
||||
if (!serv) serv = "0";
|
||||
/* try resolving */
|
||||
err = socket_gaistrerror(getaddrinfo(address, serv, bindhints, &resolved));
|
||||
if (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue