mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-28 15:06:02 -05:00
[spotify] Fix for session retry and compile warning
This commit is contained in:
parent
7d4d5e98b3
commit
d02fc308ec
@ -1,3 +1,5 @@
|
||||
#define _GNU_SOURCE // For asprintf and vasprintf
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
@ -608,7 +610,7 @@ resolve_server_info_set(struct sp_server *server, const char *key, json_object *
|
||||
RETURN_ERROR(SP_ERR_NOCONNECTION, "Unexpected data in response from access point resolver");
|
||||
|
||||
s = json_object_get_string(instance); // This string includes the port
|
||||
is_same = (server->address && strncmp(s, server->address, strlen(server->address) == 0));
|
||||
is_same = server->address && (strncmp(s, server->address, strlen(server->address)) == 0);
|
||||
|
||||
if (is_same && has_failed)
|
||||
s = NULL; // This AP has failed on us recently, so avoid
|
||||
|
@ -1,3 +1,4 @@
|
||||
#define _GNU_SOURCE // For asprintf and vasprintf
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -267,6 +267,12 @@ session_retry(struct sp_session *session)
|
||||
|
||||
ap_disconnect(&session->conn);
|
||||
|
||||
// If we were doing something other than login, queue that
|
||||
if (session->request->seq_type != SP_SEQ_LOGIN)
|
||||
seq_next_set(session, session->request->seq_type);
|
||||
|
||||
// Trigger login on a new server
|
||||
session->request = seq_request_get(SP_SEQ_LOGIN, 0, session->use_legacy);
|
||||
sequence_continue(session);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user