mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
better handling of AIrPlay network issues - release
This commit is contained in:
@@ -276,6 +276,7 @@ bool raop_cmd(struct raop_ctx_s *ctx, raop_event_t event, void *param) {
|
||||
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
bool raop_cmd(struct raop_ctx_s *ctx, raop_event_t event, void *param) {
|
||||
struct sockaddr_in addr;
|
||||
@@ -325,7 +326,7 @@ bool raop_cmd(struct raop_ctx_s *ctx, raop_event_t event, void *param) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
// no command to send to remote or no remote found yet
|
||||
@@ -348,16 +349,19 @@ bool raop_cmd(struct raop_ctx_s *ctx, raop_event_t event, void *param) {
|
||||
|
||||
asprintf(&method, "GET /ctrl-int/1/%s HTTP/1.0", command);
|
||||
kd_add(headers, "Active-Remote", ctx->active_remote.id);
|
||||
kd_add(headers, "Connection", "close");
|
||||
kd_add(headers, "Connection", "close");
|
||||
|
||||
buf = http_send(sock, method, headers);
|
||||
len = recv(sock, resp, 512, 0);
|
||||
if (len > 0) resp[len-1] = '\0';
|
||||
if (len > 0) resp[len-1] = '\0';
|
||||
LOG_INFO("[%p]: sending airplay remote\n%s<== received ==>\n%s", ctx, buf, resp);
|
||||
|
||||
NFREE(method);
|
||||
NFREE(buf);
|
||||
kd_free(headers);
|
||||
success = true;
|
||||
} else {
|
||||
kd_free(headers);
|
||||
LOG_INFO("[%p]: can't connect to remote for %s", ctx, command);
|
||||
}
|
||||
|
||||
free(command);
|
||||
|
||||
Reference in New Issue
Block a user