19 Feb
2009
19 Feb
'09
5:03 p.m.
On Thu, Feb 19, 2009 at 12:55 AM, Sebastian Nowicki <sebnow@gmail.com> wrote:
This allows a frontend to define its own download algorithm so that the libfetch dependency can be omitted without using an external process. The callback will be used when if it is defined, otherwise the old behavior applies.
I like this, but my first thought is: why not extrapolate our current downloading as a "fetch callback" too? That way the check just needs a "!= NULL" before calling it, and it can be done on config parsing: //in initialization #ifdef INTERNAL_DOWNLOAD fetchcb = internal_fetch; #else fetchcb = NULL; #endif ... ... // in config parsing if(strcmp(blah, "XferCommand") == 0) { fetchcb = use_xfercommand; }