[FFmpeg-cvslog] r23154 - trunk/ffserver.c
mstorsjo
subversion
Tue May 18 13:16:12 CEST 2010
Author: mstorsjo
Date: Tue May 18 13:16:12 2010
New Revision: 23154
Log:
ffserver: Write proper GMT date/times in Date headers
Patch by Howard Chu, hyc at highlandsun dot com
Modified:
trunk/ffserver.c
Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c Tue May 18 00:49:34 2010 (r23153)
+++ trunk/ffserver.c Tue May 18 13:16:12 2010 (r23154)
@@ -2777,7 +2777,7 @@ static void rtsp_reply_header(HTTPContex
{
const char *str;
time_t ti;
- char *p;
+ struct tm *tm;
char buf2[32];
switch(error_number) {
@@ -2824,11 +2824,8 @@ static void rtsp_reply_header(HTTPContex
/* output GMT time */
ti = time(NULL);
- p = ctime(&ti);
- strcpy(buf2, p);
- p = buf2 + strlen(p) - 1;
- if (*p == '\n')
- *p = '\0';
+ tm = gmtime(&ti);
+ strftime(buf2, sizeof(buf2), "%a, %d %b %Y %H:%M:%S", tm);
url_fprintf(c->pb, "Date: %s GMT\r\n", buf2);
}
More information about the ffmpeg-cvslog
mailing list