Commit 471f1d69 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

fixes bug report #547484, no_proxy doesn't properly strip off port numbers

from the host names before comparing
parent 495f6f6b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1611,9 +1611,16 @@ static CURLcode CreateConnection(struct SessionHandle *data,

      nope=no_proxy?strtok_r(no_proxy, ", ", &no_proxy_tok_buf):NULL;
      while(nope) {
        if(strlen(nope) <= strlen(conn->name)) {
        int namelen;
        char *endptr = strchr(conn->name, ':');
        if(endptr)
          namelen=endptr-conn->name;
        else
          namelen=strlen(conn->name);

        if(strlen(nope) <= namelen) {
          char *checkn=
            conn->name + strlen(conn->name) - strlen(nope);
            conn->name + namelen - strlen(nope);
          if(strnequal(nope, checkn, strlen(nope))) {
            /* no proxy for this host! */
            break;