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

Conflicts:
	components/wifi-manager/http_server.c
This commit is contained in:
Sebastien
2020-02-24 16:15:34 -05:00
53 changed files with 2291 additions and 1698 deletions

View File

@@ -55,7 +55,7 @@ typedef struct raop_ctx_s {
short unsigned port; // RTSP port for AirPlay
int sock; // socket of the above
struct in_addr peer; // IP of the iDevice (airplay sender)
bool running, abort;
bool running;
#ifdef WIN32
pthread_t thread, search_thread;
#else
@@ -63,6 +63,11 @@ typedef struct raop_ctx_s {
StaticTask_t *xTaskBuffer;
StackType_t xStack[RTSP_STACK_SIZE] __attribute__ ((aligned (4)));
#endif
/*
Compiler/Execution bug: if this bool is next to 'running', the rtsp_thread
loop sees 'running' being set to false from at first execution ...
*/
bool abort;
unsigned char mac[6];
int latency;
struct {
@@ -182,7 +187,7 @@ struct raop_ctx_s *raop_create(struct in_addr host, char *name,
#ifdef WIN32
getsockname(ctx->sock, (struct sockaddr *) &addr, &nlen);
ctx->port = ntohs(addr.sin_port);
#endif
#endif
ctx->running = true;
@@ -214,7 +219,7 @@ void raop_delete(struct raop_ctx_s *ctx) {
/*----------------------------------------------------------------------------*/
void raop_delete(struct raop_ctx_s *ctx) {
#ifdef WIN32
#ifdef WIN32
int sock;
struct sockaddr addr;
socklen_t nlen = sizeof(struct sockaddr);
@@ -406,7 +411,7 @@ static void *rtsp_thread(void *arg) {
if (n > 0) res = handle_rtsp(ctx, sock);
if (n < 0 || !res || ctx->abort) {
abort_rtsp(ctx);
abort_rtsp(ctx);
closesocket(sock);
LOG_INFO("RTSP close %u", sock);
sock = -1;
@@ -692,10 +697,10 @@ void abort_rtsp(raop_ctx_t *ctx) {
ctx->active_remote.joiner = xTaskGetCurrentTaskHandle();
ctx->active_remote.running = false;
xSemaphoreTake(ctx->active_remote.destroy_mutex, portMAX_DELAY);
xSemaphoreTake(ctx->active_remote.destroy_mutex, portMAX_DELAY);
vTaskDelete(ctx->active_remote.thread);
vSemaphoreDelete(ctx->active_remote.thread);
heap_caps_free(ctx->active_remote.xTaskBuffer);
memset(&ctx->active_remote, 0, sizeof(ctx->active_remote));