Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Chu <hyc@highlandsun.com>2010-05-18 15:16:12 +0400
committerMartin Storsjö <martin@martin.st>2010-05-18 15:16:12 +0400
commit0156fcf25210660d85cacf413efc839ec7412eca (patch)
treee53544e9805d6bb120b419af3c9b172cc45fe576 /ffserver.c
parentfecd7b457e5908f2758bda78753c851159cad91a (diff)
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
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ffserver.c b/ffserver.c
index 7dcc9b23fd..628952a163 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2777,7 +2777,7 @@ static void rtsp_reply_header(HTTPContext *c, enum RTSPStatusCode error_number)
{
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(HTTPContext *c, enum RTSPStatusCode error_number)
/* 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);
}