From: Mike Brady Date: Fri, 25 May 2018 08:36:17 +0000 (+0100) Subject: If a TEARDOWN request is received, print the message and the response. X-Git-Tag: 3.2RC10~3^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3aba10e3cc4529065b49ff705d71b03277dabb96;p=thirdparty%2Fshairport-sync.git If a TEARDOWN request is received, print the message and the response. --- diff --git a/rtsp.c b/rtsp.c index a0e79118..4ac036c3 100644 --- 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);