summaryrefslogtreecommitdiff
path: root/lftp-4.0.9-date_fmt.patch
diff options
context:
space:
mode:
Diffstat (limited to 'lftp-4.0.9-date_fmt.patch')
-rw-r--r--lftp-4.0.9-date_fmt.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/lftp-4.0.9-date_fmt.patch b/lftp-4.0.9-date_fmt.patch
new file mode 100644
index 0000000..199969f
--- /dev/null
+++ b/lftp-4.0.9-date_fmt.patch
@@ -0,0 +1,30 @@
+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 @@
+ #include <errno.h>
+ #include <stdarg.h>
+ #include <time.h>
++#include <limits.h>
+ #include <fnmatch.h>
+ #include <locale.h>
+ #include <assert.h>
+diff --git a/src/Http.cc b/src/Http.cc
+index b84a729..faf0cc5 100644
+--- a/src/Http.cc
++++ b/src/Http.cc
+@@ -786,9 +786,11 @@ void Http::SendRequest(const char *connection,const char *f)
+ (long long)((limit==FILE_END || limit>entity_size ? entity_size : limit)-1),
+ (long long)entity_size);
+ }
+- if(entity_date!=NO_DATE)
++ if((entity_date!=NO_DATE) && (entity_date>0L && entity_date<INT_MAX))
+ {
+- Send("Last-Modified: %s\r\n",FormatLastModified(entity_date).get());
++ char d[256];
++ strftime(d, sizeof(d), "%a, %d %b %H:%M:%S %Y GMT", gmtime(&entity_date));
++ Send("Last-Modified: %s\r\n",d);
+ Send("X-OC-MTime: %ld\r\n",(long)entity_date); // for OwnCloud
+ }
+ break;