Commit 0eda142e authored by Ben Greear's avatar Ben Greear Committed by Daniel Stenberg
Browse files

allow user+password in the URL for all protocols

Ben Greear brought a patch that from now on allows all protocols
to specify name and user within the URL, in the same manner HTTP
and FTP have been allowed to in the past - although far from all
of the libcurl supported protocols actually have that feature in
their URL definition spec.
parent e2bd52e5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6,6 +6,12 @@

                                  Changelog

Daniel Stenberg (27 Mar 2010)
- Ben Greear brought a patch that from now on allows all protocols to specify
  name and user within the URL, in the same manner HTTP and FTP have been
  allowed to in the past - although far from all of the libcurl supported
  protocls actually have that feature in their URL definition spec.

Daniel Stenberg (26 Mar 2010)
- Ben Greear brought code that makes the rate limiting code for the easy
  interface a bit smoother as it introduces sub-second sleeps during it and it
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ This release includes the following changes:

 o The 'ares' subtree has been removed from the source repository
 o smoother rate limiting
 o allow user+password in URL for all protocols

This release includes the following bugfixes:

+50 −51
Original line number Diff line number Diff line
@@ -4113,15 +4113,15 @@ static CURLcode parse_url_userpass(struct SessionHandle *data,
   * We need somewhere to put the embedded details, so do that first.
   */

  char *ptr=strchr(conn->host.name, '@');
  char *userpass = conn->host.name;

  user[0] =0;   /* to make everything well-defined */
  passwd[0]=0;

  if(conn->protocol & (PROT_FTP|PROT_HTTP|PROT_SCP|PROT_SFTP)) {
    /* This is a FTP, HTTP, SCP or SFTP URL, we will now try to extract the
  /* We will now try to extract the
   * possible user+password pair in a string like:
   * ftp://user:password@ftp.my.site:8021/README */
    char *ptr=strchr(conn->host.name, '@');
    char *userpass = conn->host.name;
  if(ptr != NULL) {
    /* there's a user+password given here, to the left of the @ */

@@ -4172,7 +4172,6 @@ static CURLcode parse_url_userpass(struct SessionHandle *data,
      }
    }
  }
  }
  return CURLE_OK;
}