url: fix port type to int (ports above 32766), use AI_NUMERICSERV in tcp and udp, fixes #2369
This commit is contained in:
parent
73bf840f14
commit
cc276263a3
3 changed files with 3 additions and 3 deletions
|
@ -647,7 +647,7 @@ tcp_server_create
|
|||
snprintf(port_buf, 6, "%d", port);
|
||||
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
hints.ai_flags = AI_PASSIVE | AI_NUMERICSERV;
|
||||
if (bindaddr != NULL)
|
||||
hints.ai_flags |= AI_NUMERICHOST;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
|
|
@ -48,7 +48,7 @@ udp_resolve( udp_connection_t *uc, int receiver )
|
|||
snprintf(port_buf, 6, "%d", uc->port);
|
||||
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_flags = receiver ? AI_PASSIVE : 0;
|
||||
hints.ai_flags = (receiver ? AI_PASSIVE : 0) | AI_NUMERICSERV;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_DGRAM;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ typedef struct url
|
|||
char *user;
|
||||
char *pass;
|
||||
char *host;
|
||||
short port;
|
||||
int port;
|
||||
char *path;
|
||||
char *query;
|
||||
char *frag;
|
||||
|
|
Loading…
Add table
Reference in a new issue