curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLE_URL_MALFORMAT

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 21 Mar 2017 08:46:35 +0100 (CET)

On Tue, 21 Mar 2017, Michael via curl-library wrote:

> in the username I need to have a -Even with this simple name/password it
> fails. Curl is default from Ubuntu but I've compiled a static lib last month
> and I don't remember what version that was. Anyway on Windows I use the
> latest curl and I get the same error. Something weird to do with - ?

I can't see any problem when trying this in my end. I tested the code below
and it works just fine. This ftp server has the good manner to accept any user
name and password so I can also verify that the one we set is actually sent
and used.

int main(int argc, char** argv)
{
   CURLcode code;
   CURL *curl = curl_easy_init();

   /* enable uploading */
   curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
   curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

   curl_easy_setopt(curl, CURLOPT_USERPWD, "u15-aha:ahaaha");
   curl_easy_setopt(curl, CURLOPT_URL,"ftp://ftp.funet.fi/");

   /* Now run off and do what you've been told! */
   code = curl_easy_perform(curl);

   curl_easy_cleanup(curl);
}

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-03-21