Changeset d8c68f7f9c768f881d6e7d1b9372cf709d1a6e52

Show
Ignore:
Timestamp:
05/07/08 18:10:25 (2 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1210176625 +0300
git-parent:

[fe182634ea51564a9f1374eb337b27890da15ef0]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1210176594 +0300
Message:

Add RTSP Date:

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/stream_out/rtsp.c

    rfe18263 rd8c68f7  
    349349    char control[sizeof("rtsp://[]:12345") + NI_MAXNUMERICHOST 
    350350                  + strlen( rtsp->psz_path )]; 
     351    time_t now; 
     352 
     353    time (&now); 
    351354 
    352355    if( answer == NULL || query == NULL || cl == NULL ) 
     
    376379    answer->i_body = 0; 
    377380    answer->p_body = NULL; 
     381 
     382    httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING ); 
     383 
     384    /* Date: is always allowed, and sometimes mandatory with RTSP/2.0. */ 
     385    struct tm ut; 
     386    if (gmtime_r (&now, &ut) != NULL) 
     387    {   /* RFC1123 format, GMT is mandatory */ 
     388        static const char wdays[7][4] = { 
     389            "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; 
     390        static const char mons[12][4] = { 
     391            "Jan", "Feb", "Mar", "Apr", "May", "Jun", 
     392            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 
     393        httpd_MsgAdd (answer, "Date", "%s, %02u %s %04u %02u:%02u:%02u GMT", 
     394                      wdays[ut.tm_wday], ut.tm_mday, mons[ut.tm_mon], 
     395                      1900 + ut.tm_year, ut.tm_hour, ut.tm_min, ut.tm_sec); 
     396    } 
    378397 
    379398    if( query->i_proto != HTTPD_PROTO_RTSP ) 
     
    690709    } 
    691710 
    692     httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING ); 
    693711    if( psz_session ) 
    694712        httpd_MsgAdd( answer, "Session", "%s"/*;timeout=5*/, psz_session );