]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Ensure player's IP is first in the perer list. Will be duplicated but that's okay.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 3 Aug 2022 11:53:06 +0000 (12:53 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 3 Aug 2022 11:53:06 +0000 (12:53 +0100)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index 076a20d7284797f598b3377bacd90a4cf2fd09a1..767e2804e5f6bdbc6f1d56804210069e20b56895 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -2439,6 +2439,12 @@ void handle_setpeers(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp
   char timing_list_message[4096];
   timing_list_message[0] = 'T';
   timing_list_message[1] = 0;
+  
+  // ensure the client itself is first -- it's okay if it's duplicated later
+  strncat(timing_list_message, " ",
+        sizeof(timing_list_message) - 1 - strlen(timing_list_message));
+  strncat(timing_list_message, (const char *)&conn->client_ip_string,
+        sizeof(timing_list_message) - 1 - strlen(timing_list_message));
 
   plist_t addresses_array = NULL;
   plist_from_memory(req->content, req->contentlength, &addresses_array);
@@ -2802,6 +2808,13 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
           timing_list_message[0] = 'T';
           timing_list_message[1] = 0;
 
+          // ensure the client itself is first -- it's okay if it's duplicated later
+          strncat(timing_list_message, " ",
+                sizeof(timing_list_message) - 1 - strlen(timing_list_message));
+          strncat(timing_list_message, (const char *)&conn->client_ip_string,
+                sizeof(timing_list_message) - 1 - strlen(timing_list_message));
+
+
           plist_t timing_peer_info = plist_dict_get_item(messagePlist, "timingPeerInfo");
           if (timing_peer_info) {
             // first, get the incoming plist.