Mercurial > hg > octave-avbm
changeset 6984:827be634619e
[project @ 2007-10-09 15:55:13 by jwe]
author | jwe |
---|---|
date | Tue, 09 Oct 2007 15:55:14 +0000 |
parents | 056fa4423303 |
children | cf2f6090147a |
files | src/ChangeLog src/DLD-FUNCTIONS/urlwrite.cc |
diffstat | 2 files changed, 2 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 <dbateman@free.fr>
--- a/src/DLD-FUNCTIONS/urlwrite.cc +++ b/src/DLD-FUNCTIONS/urlwrite.cc @@ -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);