Merge remote-tracking branch 'origin/master' into master-cmake

Conflicts:
	components/raop/raop.c
	components/raop/rtp.c
This commit is contained in:
Sebastien
2020-03-10 10:52:18 -04:00
13 changed files with 950 additions and 897 deletions

View File

@@ -23,12 +23,7 @@
#ifdef WIN32
#include <iphlpapi.h>
#else
/*
#include <sys/ioctl.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <netdb.h>
*/
#include "tcpip_adapter.h"
#include <ctype.h>
#endif
@@ -84,8 +79,26 @@ in_addr_t get_localhost(char **name)
}
else return INADDR_ANY;
#else
// missing platform here ...
return INADDR_ANY;
tcpip_adapter_ip_info_t ipInfo;
tcpip_adapter_if_t if_type = TCPIP_ADAPTER_IF_STA;
// then get IP address
tcpip_adapter_get_ip_info(if_type, &ipInfo);
// we might be in AP mode
if (ipInfo.ip.addr == INADDR_ANY) {
if_type = TCPIP_ADAPTER_IF_AP;
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ipInfo);
}
// get hostname if required
if (name) {
const char *hostname;
tcpip_adapter_get_hostname(if_type, &hostname);
*name = strdup(hostname);
}
return ipInfo.ip.addr;
#endif
}
@@ -401,7 +414,7 @@ bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len)
}
if (*len) {
int size = 0;
int size = 0;
*body = malloc(*len + 1);
while (*body && size < *len) {