]> git.sesse.net Git - vlc/commitdiff
Implement the Timestamp header
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 26 Aug 2007 07:20:34 +0000 (07:20 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 26 Aug 2007 07:20:34 +0000 (07:20 +0000)
modules/stream_out/rtsp.c
src/network/httpd.c

index 151270db781f52ea2a3376815957ff96000f52e3..3689113f4ad5c69459f1b1c8465c4fc62c7411df 100644 (file)
@@ -287,7 +287,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args,
                          httpd_message_t *answer, httpd_message_t *query )
 {
     rtsp_stream_t *rtsp = (rtsp_stream_t *)p_args;
-    const char *psz_session = NULL, *psz_cseq;
+    const char *psz_session = NULL, *psz;
 
     if( answer == NULL || query == NULL )
     {
@@ -387,9 +387,14 @@ static int RtspCallback( httpd_callback_sys_t *p_args,
 
     httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
     httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body );
-    psz_cseq = httpd_MsgGet( query, "Cseq" );
-    if( psz_cseq )
-        httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq );
+
+    psz = httpd_MsgGet( query, "Cseq" );
+    if( psz != NULL )
+        httpd_MsgAdd( answer, "Cseq", "%s", psz );
+    psz = httpd_MsgGet( query, "Timestamp" );
+    if( psz != NULL )
+        httpd_MsgAdd( answer, "Timestamp", "%s", psz );
+
     httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" );
 
     if( psz_session )
@@ -433,8 +438,7 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
     rtsp_stream_t    *rtsp = id->stream;
     sout_stream_t    *p_stream = id->stream->owner;
     char psz_session_init[21];
-    const char *psz_session;
-    const char *psz_cseq;
+    const char *psz_session, *psz;
 
     if( answer == NULL || query == NULL )
         return VLC_SUCCESS;
@@ -701,9 +705,12 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
             break;
     }
 
-    psz_cseq = httpd_MsgGet( query, "Cseq" );
-    if( psz_cseq )
-        httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq );
+    psz = httpd_MsgGet( query, "Cseq" );
+    if( psz != NULL )
+        httpd_MsgAdd( answer, "Cseq", "%s", psz );
+    psz = httpd_MsgGet( query, "Timestamp" );
+    if( psz != NULL )
+        httpd_MsgAdd( answer, "Timestamp", "%s", psz );
     httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
     httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body );
     httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" );
index 67acd881d2a139605bbf97f4d2e9bacbf17f66fe..09932fbdd076c551a8aa36825455afced4d2e81f 100644 (file)
@@ -2048,12 +2048,20 @@ static void httpd_HostThread( httpd_host_t *host )
                     answer->i_body = 0;
                     answer->p_body = NULL;
 
+                    psz = httpd_MsgGet( query, "Require" );
+                    if( psz != NULL )
+                    {
+                        answer->i_status = 551;
+                        httpd_MsgAdd( query, "Unsupported", "%s", psz );
+                    }
+
                     psz = httpd_MsgGet( query, "Cseq" );
                     if( psz != NULL )
                         httpd_MsgAdd( answer, "Cseq", "%s", psz );
-                    psz = httpd_MsgGet( query, "Require" );
+                    psz = httpd_MsgGet( query, "Timestamp" );
                     if( psz != NULL )
-                        httpd_MsgAdd( query, "Unsupported", "%s", psz );
+                        httpd_MsgAdd( answer, "Timestamp", "%s", psz );
+
                     httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
                     httpd_MsgAdd( answer, "Public", "DESCRIBE, SETUP, "
                                  "TEARDOWN, PLAY, PAUSE" );