# HG changeset patch # User jwe # Date 1191945314 0 # Node ID 827be634619e3573addc97e2e658249fa8515f25 # Parent 056fa4423303f5bdc594a3221e4060f396f9f3c6 [project @ 2007-10-09 15:55:13 by jwe] diff -r 056fa4423303 -r 827be634619e src/ChangeLog --- a/src/ChangeLog Tue Oct 09 15:30:36 2007 +0000 +++ b/src/ChangeLog Tue Oct 09 15:55:14 2007 +0000 @@ -3,6 +3,8 @@ * DLD-FUNCTIONS/urlwrite.cc (Furlwrite, Furlread) [! HAVE_CURL]: Throw error instead of returning empty string hiding error message in third return value. + (progress_func): Delete. + (Furlread): Don't set progress callback for curl. 2007-10-08 David Bateman diff -r 056fa4423303 -r 827be634619e src/DLD-FUNCTIONS/urlwrite.cc --- a/src/DLD-FUNCTIONS/urlwrite.cc Tue Oct 09 15:30:36 2007 +0000 +++ b/src/DLD-FUNCTIONS/urlwrite.cc Tue Oct 09 15:55:14 2007 +0000 @@ -58,30 +58,6 @@ return (stream.fail () ? 0 : size * nmemb); } -// Progress callback function for curl. - -int -progress_func (const char *url, double dltotal, double dlnow, - double /*ultotal*/, double /*ulnow*/) -{ - // macro that picks up Ctrl-C signalling - OCTAVE_QUIT; - -#if !defined (URL_QUITE_DOWNLOAD) - if (dltotal != 0) - { - // Is the carriage return character "\r" portable? - octave_stdout << "\r" << url << ": " - << std::fixed << std::setw(5) << std::setprecision(1) - << dlnow*100.0/dltotal << " %"; - - octave_stdout.flush (); - } -#endif - - return 0; -} - // Form the query string based on param. std::string @@ -157,7 +133,6 @@ curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt (curl, CURLOPT_NOPROGRESS, false); - curl_easy_setopt (curl, CURLOPT_PROGRESSFUNCTION, progress_func); curl_easy_setopt (curl, CURLOPT_PROGRESSDATA, url.c_str ()); curl_easy_setopt (curl, CURLOPT_FAILONERROR, true); @@ -166,16 +141,6 @@ CURLcode res = curl_easy_perform(curl); -#if !defined (URL_QUITE_DOWNLOAD) - if (res == CURLE_OK) - { - // download is complete - progress_func (url.c_str (), 1, 1, 0, 0); - // new line after progress_func - octave_stdout << std::endl; - } -#endif - // always cleanup curl_easy_cleanup (curl);