]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
If a TEARDOWN request is received, print the message and the response.
authorMike Brady <mikebrady@eircom.net>
Fri, 25 May 2018 08:36:17 +0000 (09:36 +0100)
committerMike Brady <mikebrady@eircom.net>
Fri, 25 May 2018 08:36:17 +0000 (09:36 +0100)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index a0e791180ca7c9af2bf98c48468b9f4682832548..4ac036c3ece27663bac16e954e0430148e6b3323 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -1877,11 +1877,14 @@ static void *rtsp_conversation_thread_func(void *pconn) {
   int rtsp_read_request_attempt_count = 1; // 1 means exit immediately
 
   while (conn->stop == 0) {
+    int debug_level = 3; // for printing the request and response
     reply = rtsp_read_request(conn, &req);
     if (reply == rtsp_read_request_response_ok) {
-      debug(3, "RTSP thread %d received an RTSP Packet of type \"%s\":", conn->connection_number,
+      if (strcmp(req->method,"TEARDOWN")==0)
+        debug_level=2;
+      debug(debug_level, "RTSP thread %d received an RTSP Packet of type \"%s\":", conn->connection_number,
             req->method),
-          debug_print_msg_headers(3, req);
+      debug_print_msg_headers(debug_level, req);
       resp = msg_init();
       resp->respcode = 400;
 
@@ -1907,8 +1910,8 @@ static void *rtsp_conversation_thread_func(void *pconn) {
           debug(1, "RTSP thread %d: Unrecognised and unhandled rtsp request \"%s\".",
                 conn->connection_number, req->method);
       }
-      debug(3, "RTSP thread %d: RTSP Response:", conn->connection_number);
-      debug_print_msg_headers(3, resp);
+      debug(debug_level, "RTSP thread %d: RTSP Response:", conn->connection_number);
+      debug_print_msg_headers(debug_level, resp);
       fd_set writefds;
       FD_ZERO(&writefds);
       FD_SET(conn->fd, &writefds);