2016-05-19 10:09:20 +00:00
|
|
|
diff --git a/src/Http.cc b/src/Http.cc
|
|
|
|
index 5364c94..0018670 100644
|
|
|
|
--- a/src/Http.cc
|
|
|
|
+++ b/src/Http.cc
|
|
|
|
@@ -26,6 +26,7 @@
|
2010-06-30 06:19:12 +00:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <time.h>
|
|
|
|
+#include <limits.h>
|
|
|
|
#include <fnmatch.h>
|
|
|
|
#include <locale.h>
|
2010-09-07 07:06:06 +00:00
|
|
|
#include <assert.h>
|
2016-05-19 10:09:20 +00:00
|
|
|
@@ -744,15 +745,10 @@ void Http::SendRequest(const char *connection,const char *f)
|
2010-06-22 17:35:12 +00:00
|
|
|
(long long)((limit==FILE_END || limit>entity_size ? entity_size : limit)-1),
|
|
|
|
(long long)entity_size);
|
|
|
|
}
|
|
|
|
- if(entity_date!=NO_DATE)
|
2016-05-19 10:09:20 +00:00
|
|
|
+ if((entity_date!=NO_DATE) && (entity_date>0L && entity_date<INT_MAX))
|
2010-06-22 17:35:12 +00:00
|
|
|
{
|
|
|
|
- static const char weekday_names[][4]={
|
|
|
|
- "Sun","Mon","Tue","Wed","Thu","Fri","Sat"
|
|
|
|
- };
|
2011-03-30 13:03:14 +00:00
|
|
|
- const struct tm *t=gmtime(&entity_date);
|
|
|
|
- const char *d=xstring::format("%s, %2d %s %04d %02d:%02d:%02d GMT",
|
2010-06-22 17:35:12 +00:00
|
|
|
- weekday_names[t->tm_wday],t->tm_mday,month_names[t->tm_mon],
|
|
|
|
- t->tm_year+1900,t->tm_hour,t->tm_min,t->tm_sec);
|
2016-05-19 10:09:20 +00:00
|
|
|
+ char d[256];
|
|
|
|
+ strftime(d, sizeof(d), "%a, %d %b %H:%M:%S %Y GMT", gmtime(&entity_date));
|
2010-06-22 17:35:12 +00:00
|
|
|
Send("Last-Modified: %s\r\n",d);
|
2016-05-19 10:09:20 +00:00
|
|
|
Send("X-OC-MTime: %ld\r\n",(long)entity_date); // for OwnCloud
|
2010-06-22 17:35:12 +00:00
|
|
|
}
|