2010-06-22 17:35:12 +00:00
|
|
|
diff -up lftp-4.0.9/src/Http.cc.date_fmt lftp-4.0.9/src/Http.cc
|
|
|
|
--- lftp-4.0.9/src/Http.cc.date_fmt 2009-07-17 14:52:26.000000000 +0200
|
2010-06-30 06:19:12 +00:00
|
|
|
+++ lftp-4.0.9/src/Http.cc 2010-06-30 08:07:00.818994525 +0200
|
|
|
|
@@ -29,6 +29,7 @@
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <time.h>
|
|
|
|
+#include <limits.h>
|
|
|
|
#include <fnmatch.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include "Http.h"
|
|
|
|
@@ -562,16 +563,10 @@ void Http::SendRequest(const char *conne
|
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)
|
2010-06-30 06:19:12 +00:00
|
|
|
+ if(entity_date!=NO_DATE && entity_date>0L && entity_date<INT_MAX)
|
2010-06-22 17:35:12 +00:00
|
|
|
{
|
|
|
|
char d[256];
|
|
|
|
- static const char weekday_names[][4]={
|
|
|
|
- "Sun","Mon","Tue","Wed","Thu","Fri","Sat"
|
|
|
|
- };
|
|
|
|
- struct tm *t=gmtime(&entity_date);
|
|
|
|
- sprintf(d,"%s, %2d %s %04d %02d:%02d:%02d GMT",
|
|
|
|
- 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);
|
|
|
|
+ strftime(d, sizeof(d), "%a, %d %b %H:%M:%S %Y GMT", gmtime(&entity_date));
|
|
|
|
Send("Last-Modified: %s\r\n",d);
|
|
|
|
}
|
|
|
|
break;
|