mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
Merge remote-tracking branch 'origin/master' into master-cmake
Conflicts: components/raop/raop.c components/raop/rtp.c
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user