Package: yafc Version: 1.3.5-2 Severity: minor Tags: upstream patch Dear maintainer,
The --newer option of the "put" command always request the file modification time from the server for every single file. Thus making tons of back and forth communications. However, this informations is usually already cached when listing directory. I guess it's exactly the same story with "get". This 3 lines patches will retrive the modification date from the cache if available. This is a huge performance improvement when the number of files is large. For instance, mediawiki is more or less 10000 files, which takes me 22 minutes and 17 seconds to check that no files need to be updated on the server with the current version. With my patch, it only takes 4 minutes and 46 seconds. Best regards, Celelibi -- System Information: Debian Release: 8.0 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: i386 (x86_64) Kernel: Linux 3.10.11 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: sysvinit (via /sbin/init) Versions of packages yafc depends on: ii libbsd0 0.7.0-2 ii libc6 2.19-17 ii libedit2 3.1-20140620-2 ii libgssapi3-heimdal 1.6~rc2+dfsg-9 ii libhcrypto4-heimdal 1.6~rc2+dfsg-9 ii libheimbase1-heimdal 1.6~rc2+dfsg-9 ii libroken18-heimdal 1.6~rc2+dfsg-9 ii libssh-4 0.6.3-4 yafc recommends no packages. yafc suggests no packages. -- no debconf information
>From 828bb37164c0dfa3c4465a20bc0c97b41ecd4332 Mon Sep 17 00:00:00 2001 From: Celelibi <[email protected]> Date: Tue, 7 Apr 2015 00:18:44 +0200 Subject: [PATCH] --newer option: use cached information Signed-off-by: Celelibi <[email protected]> --- src/ftp/ftp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ftp/ftp.c b/src/ftp/ftp.c index 162ed61..e74f9bf 100644 --- a/src/ftp/ftp.c +++ b/src/ftp/ftp.c @@ -1782,6 +1782,7 @@ time_t gmt_mktime(const struct tm *ts) time_t ftp_filetime(const char *filename) { struct tm ts; + rfile *f; if(!ftp_connected()) return -1; @@ -1791,6 +1792,10 @@ time_t ftp_filetime(const char *filename) return ssh_filetime(filename); #endif + f = ftp_cache_get_file(filename); + if (f) + return f->mtime; + if(!ftp->has_mdtm_command) return -1; -- 2.1.4

