- Daniel Fandrich found out we didn't pass on the user-agent properly when
authorDaniel Stenberg <daniel@haxx.se>
Fri, 11 Jul 2008 09:08:27 +0000 (09:08 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 11 Jul 2008 09:08:27 +0000 (09:08 +0000)
  doing "proxy-tunnels" with non-HTTP prototols and that was simply because
  the code assumed the user-agent was only needed for HTTP.

CHANGES
RELEASE-NOTES
lib/url.c

diff --git a/CHANGES b/CHANGES
index bfa1942..82e3d5a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Daniel Stenberg (11 Jul 2008)
+- Daniel Fandrich found out we didn't pass on the user-agent properly when
+  doing "proxy-tunnels" with non-HTTP prototols and that was simply because
+  the code assumed the user-agent was only needed for HTTP.
+
 Daniel Fandrich (10 Jul 2008)
 - Changed slightly the SFTP quote commands chmod, chown and chgrp to only
   set the attribute that has changed instead of all possible ones. Hopefully,
index 0983411..25e90ba 100644 (file)
@@ -33,6 +33,7 @@ This release includes the following bugfixes:
  o FTP transfers segfault when using different CURLOPT_FTP_FILEMETHOD
  o c-ares powered libcurls can resolve/use IPv6 addresses
  o poll not working on Windows Vista due to POLLPRI being incorrectly used
+ o user-agent in CONNECT with non-HTTP protocols
 
 This release includes the following known bugs:
 
index 4238256..58c7331 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4278,10 +4278,12 @@ static CURLcode setup_conn(struct connectdata *conn,
      lingering set from a previous invoke */
   conn->bits.proxy_connect_closed = FALSE;
 
-  /*************************************************************
-   * Set user-agent for HTTP
-   *************************************************************/
-  if((conn->protocol&PROT_HTTP) && data->set.str[STRING_USERAGENT]) {
+  /*
+   * Set user-agent. Used for HTTP, but since we can attempt to tunnel
+   * basically anything through a http proxy we can't limit this based on
+   * protocol.
+   */
+  if(data->set.str[STRING_USERAGENT]) {
     Curl_safefree(conn->allocptr.uagent);
     conn->allocptr.uagent =
       aprintf("User-Agent: %s\r\n", data->set.str[STRING_USERAGENT]);