]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
respond with status 401 to all requests
authorAndreas Öman <andreas@lonelycoder.com>
Sun, 25 Nov 2007 08:48:44 +0000 (08:48 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sun, 25 Nov 2007 08:48:44 +0000 (08:48 +0000)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index ac6cfd9cbec39dbd26cce61c9fead107cf616cb8..2739736b20fb64ae5da8b39a7c00426ba21d6042 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -254,6 +254,8 @@ rtsp_reply_error(http_connection_t *hc, int error, const char *errstr)
   http_printf(hc, "RTSP/1.0 %d %s\r\n", error, errstr);
   if((c = http_arg_get(&hc->hc_args, "cseq")) != NULL)
     http_printf(hc, "CSeq: %s\r\n", c);
+  if(error == HTTP_STATUS_UNAUTHORIZED)
+    http_printf(hc, "WWW-Authenticate: Basic realm=\"tvheadend\"\r\n");
   http_printf(hc, "\r\n");
 }
 
@@ -562,6 +564,9 @@ rtsp_cmd_teardown(http_connection_t *hc)
 int 
 rtsp_process_request(http_connection_t *hc)
 {
+  rtsp_reply_error(hc, RTSP_STATUS_UNAUTHORIZED, NULL);
+  return 0;
+
   switch(hc->hc_cmd) {
   default:
     rtsp_reply_error(hc, RTSP_STATUS_METHOD, NULL);