diff --git a/src/main/select.c b/src/main/select.c index d4d0d4b78..8b62df246 100644 --- a/src/main/select.c +++ b/src/main/select.c @@ -243,7 +243,7 @@ sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { GlobalInfo *g = (GlobalInfo*) cbp; SockInfo *fdp = (SockInfo*) sockp; - const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; +// const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; //fprintf(stderr, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); @@ -263,6 +263,7 @@ sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) return 0; } +#if 0 /* CURLOPT_WRITEFUNCTION */ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) @@ -319,6 +320,7 @@ new_conn(char *url, GlobalInfo *g) /* note that the add_handle() will set a time-out to trigger very soon so that the necessary socket_action() call will be called by this app */ } +#endif const char * get_libevent_version(void) diff --git a/src/protocol/curl/ftp.c b/src/protocol/curl/ftp.c index c0df9e944..5b385e1a4 100644 --- a/src/protocol/curl/ftp.c +++ b/src/protocol/curl/ftp.c @@ -542,6 +542,9 @@ out_of_mem: if (add_fragment(conn->cached, conn->from, buffer, len) == 1) { conn->tries = 0; } + if (conn->from == 0 && conn->est_length == -1) { + curl_easy_getinfo(ftp->easy, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &conn->est_length); + } conn->from += len; conn->received += len; return;