libfetch ftp patch for less latency

Nate Lawson nate at root.org
Thu Mar 29 00:17:37 UTC 2007


To speed up pkg_add and other ftp command channel performance over slow
links, change this:

>>> PWD
<<< 257 "/"
>>> CWD pub
<<< 250 Directory successfully changed.
>>> CWD FreeBSD
<<< 250 Directory successfully changed.
>>> CWD ports
<<< 250 Directory successfully changed.
>>> CWD amd64
<<< 250 Directory successfully changed.
>>> CWD packages-6-stable
<<< 250 Directory successfully changed.
>>> CWD Latest
<<< 250 Directory successfully changed.
>>> MODE S

Into this:

>>> PWD
<<< 257 "/"
>>> CWD pub/FreeBSD/ports/amd64/packages-6-stable/Latest
<<< 250 Directory successfully changed.

All ftp servers I've ever seen support a full path when changing down
dirs. This might be a DOS ftp server thing however.  In any case, if
there is an error to the all-in-one CWD, the code reverts back to legacy
behavior of multiple CWDs.

-- 
Nate
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftp.diff
Type: text/x-patch
Size: 1647 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20070329/3d693848/ftp.bin


More information about the freebsd-current mailing list