From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:41:47 +0000 (+0100) Subject: Uncomment code to list the contents of an incoming message. Get the source airplay... X-Git-Tag: 4.1-dev~4^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=078b7080874d9eba4d336de797e034a562592a92;p=thirdparty%2Fshairport-sync.git Uncomment code to list the contents of an incoming message. Get the source airplay version. Quieten some messages. --- diff --git a/rtsp.c b/rtsp.c index 8737a2da..98d0a75c 100644 --- a/rtsp.c +++ b/rtsp.c @@ -840,7 +840,7 @@ int msg_handle_line(rtsp_message **pmsg, char *line) { *p = 0; p += 2; msg_add_header(msg, line, p); - // debug(3, " %s: %s.", line, p); + debug(3, " %s: %s.", line, p); return -1; } else { char *cl = msg_get_header(msg, "Content-Length"); @@ -1408,8 +1408,19 @@ void handle_record(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) void handle_get_info(__attribute((unused)) rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) { - if (rtsp_message_contains_plist(req)) { // it's stage one + + if (rtsp_message_contains_plist(req)) { // it's stage one + // get version of AirPlay -- it might be too old. Not using it yet. + char *hdr = msg_get_header(req, "User-Agent"); + if (hdr) { + if (strstr(hdr, "AirPlay/") == hdr) { + hdr = hdr + strlen("AirPlay/"); + //double airplay_version = 0.0; + //airplay_version = atof(hdr); + debug(1,"Connection %d: GET_INFO: Source AirPlay Version is: %s.",conn->connection_number, hdr); + } + } plist_t info_plist = NULL; plist_from_memory(req->content, req->contentlength, &info_plist); @@ -1490,7 +1501,7 @@ void handle_get_info(__attribute((unused)) rtsp_conn_info *conn, rtsp_message *r } void handle_flushbuffered(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) { - debug(3, "Connection %d: FLUSHBUFFERED %s :: Content-Length %d", conn->connection_number, + debug(3, "Connection %d: FLUSHBUFFERED %s : Content-Length %d", conn->connection_number, req->path, req->contentlength); debug_log_rtsp_message(2, "FLUSHBUFFERED request", req); @@ -2713,7 +2724,7 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) } else { debug(1, "SETUP on Connection %d: Unrecognised SETUP incoming message from %s", conn->connection_number, (const char *)conn->client_ip_string); - debug_log_rtsp_message(1, "Unrecognised SETUP incoming message.", req); + debug_log_rtsp_message(2, "Unrecognised SETUP incoming message.", req); warn("Unrecognised SETUP incoming message -- ignored."); } debug_log_rtsp_message(2, " SETUP response", resp);