changeset 9918:57b41617c9fd

avoid LIBCURL version check
author John W. Eaton <jwe@octave.org>
date Fri, 04 Dec 2009 16:05:02 -0500
parents c1210502785b
children a463aa0aa0ab
files src/ChangeLog src/DLD-FUNCTIONS/urlwrite.cc
diffstat 2 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-04  John W. Eaton  <jwe@octave.org>
+
+	* DLD-FUNCTIONS/urlwrite.cc (curl_handle::init): Always use
+	CURLOPT_USERPWD instead of CURLOPT_USER and CURLOPT_PASSWD.
+
 2009-12-04  John W. Eaton  <jwe@octave.org>
 
 	* version.h.in (OCTAVE_API_VERSION_NUMBER): New macro.
--- a/src/DLD-FUNCTIONS/urlwrite.cc
+++ b/src/DLD-FUNCTIONS/urlwrite.cc
@@ -560,23 +560,10 @@
       setopt (CURLOPT_NOBODY, 1);
 
       // Set the username and password
-#if (LIBCURL_VERSION_NUM >= 0x071300)
-      // This is possible since cURL 7.19.
-      if (user.length () != 0)
-	setopt (CURLOPT_USERNAME, user.c_str());
-      if (passwd.length () != 0)
-	setopt (CURLOPT_PASSWORD, passwd.c_str());
-#else
-      // Probably needs to be static to remain valid long enough.
-      static std::string userpwd;
-      if (user.length () != 0)
-        {
-          userpwd = user;
-          if (passwd.length () != 0)
-            userpwd += ':' + passwd;
-          setopt (CURLOPT_USERPWD, userpwd.c_str ());
-        }
-#endif
+      std::string userpwd = user;
+      if (! passwd.empty ())
+	userpwd += ":" + passwd;
+      setopt (CURLOPT_USERPWD, userpwd.c_str ());
 
       // Define our callback to get called when there's data to be written.
       setopt (CURLOPT_WRITEFUNCTION, write_data);