# HG changeset patch # User thecrux@gmail.com # Date 1259511276 0 # Node ID f2a69bee9ef6bdb9427537afea981ccdf5604500 # Parent 39a48c780bcb2c2e750cdd213e2c23df27e47528 Don't send Proxy-Authorization headers until we've received a `407 Proxy Authentication Required` response from the server. Fixes #2910, which has an additional component about using existing kerberos tickets that should be moved to a new trac ticket. committer: John Bailey diff -r 39a48c780bcb -r f2a69bee9ef6 libpurple/proxy.c --- a/libpurple/proxy.c Sun Nov 29 03:19:51 2009 +0000 +++ b/libpurple/proxy.c Sun Nov 29 16:14:36 2009 +0000 @@ -1099,36 +1099,6 @@ connect_data->host, connect_data->port, connect_data->host, connect_data->port); - if (purple_proxy_info_get_username(connect_data->gpi) != NULL) - { - char *t1, *t2, *ntlm_type1; - char hostname[256]; - - ret = gethostname(hostname, sizeof(hostname)); - hostname[sizeof(hostname) - 1] = '\0'; - if (ret < 0 || hostname[0] == '\0') { - purple_debug_warning("proxy", "gethostname() failed -- is your hostname set?"); - strcpy(hostname, "localhost"); - } - - t1 = g_strdup_printf("%s:%s", - purple_proxy_info_get_username(connect_data->gpi), - purple_proxy_info_get_password(connect_data->gpi) ? - purple_proxy_info_get_password(connect_data->gpi) : ""); - t2 = purple_base64_encode((const guchar *)t1, strlen(t1)); - g_free(t1); - - ntlm_type1 = purple_ntlm_gen_type1(hostname, ""); - - g_string_append_printf(request, - "Proxy-Authorization: Basic %s\r\n" - "Proxy-Authorization: NTLM %s\r\n" - "Proxy-Connection: Keep-Alive\r\n", - t2, ntlm_type1); - g_free(ntlm_type1); - g_free(t2); - } - g_string_append(request, "\r\n"); connect_data->write_buf_len = request->len;