ffserver: Write proper GMT date/times in Date headers

Patch by Howard Chu, hyc at highlandsun dot com

Originally committed as revision 23154 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Howard Chu 2010-05-18 11:16:12 +00:00 committed by Martin Storsjö
parent fecd7b457e
commit 0156fcf252

View File

@ -2777,7 +2777,7 @@ static void rtsp_reply_header(HTTPContext *c, enum RTSPStatusCode error_number)
{ {
const char *str; const char *str;
time_t ti; time_t ti;
char *p; struct tm *tm;
char buf2[32]; char buf2[32];
switch(error_number) { switch(error_number) {
@ -2824,11 +2824,8 @@ static void rtsp_reply_header(HTTPContext *c, enum RTSPStatusCode error_number)
/* output GMT time */ /* output GMT time */
ti = time(NULL); ti = time(NULL);
p = ctime(&ti); tm = gmtime(&ti);
strcpy(buf2, p); strftime(buf2, sizeof(buf2), "%a, %d %b %Y %H:%M:%S", tm);
p = buf2 + strlen(p) - 1;
if (*p == '\n')
*p = '\0';
url_fprintf(c->pb, "Date: %s GMT\r\n", buf2); url_fprintf(c->pb, "Date: %s GMT\r\n", buf2);
} }