comparison libpurple/util.c @ 31534:a8cc50c2279f

Remove trailing whitespace
author Richard Laager <rlaager@wiktel.com>
date Tue, 04 Jan 2011 06:55:30 +0000
parents 65ef833303b0
children c61d3e5ec1da
comparison
equal deleted inserted replaced
31533:44f53d3fc54f 31534:a8cc50c2279f
3947 && (purple_proxy_info_get_type(gpi) == PURPLE_PROXY_USE_ENVVAR 3947 && (purple_proxy_info_get_type(gpi) == PURPLE_PROXY_USE_ENVVAR
3948 || purple_proxy_info_get_type(gpi) == PURPLE_PROXY_HTTP)) { 3948 || purple_proxy_info_get_type(gpi) == PURPLE_PROXY_HTTP)) {
3949 /* This chunk of code was copied from proxy.c http_start_connect_tunneling() 3949 /* This chunk of code was copied from proxy.c http_start_connect_tunneling()
3950 * This is really a temporary hack - we need a more complete proxy handling solution, 3950 * This is really a temporary hack - we need a more complete proxy handling solution,
3951 * so I didn't think it was worthwhile to refactor for reuse 3951 * so I didn't think it was worthwhile to refactor for reuse
3952 */ 3952 */
3953 char *t1, *t2, *ntlm_type1; 3953 char *t1, *t2, *ntlm_type1;
3954 char hostname[256]; 3954 char hostname[256];
3955 int ret; 3955 int ret;
3956 3956
3957 ret = gethostname(hostname, sizeof(hostname)); 3957 ret = gethostname(hostname, sizeof(hostname));
3958 hostname[sizeof(hostname) - 1] = '\0'; 3958 hostname[sizeof(hostname) - 1] = '\0';
3959 if (ret < 0 || hostname[0] == '\0') { 3959 if (ret < 0 || hostname[0] == '\0') {
3960 purple_debug_warning("util", "proxy - gethostname() failed -- is your hostname set?"); 3960 purple_debug_warning("util", "proxy - gethostname() failed -- is your hostname set?");
3961 strcpy(hostname, "localhost"); 3961 strcpy(hostname, "localhost");
3962 } 3962 }
3963 3963
3964 t1 = g_strdup_printf("%s:%s", 3964 t1 = g_strdup_printf("%s:%s",
3965 purple_proxy_info_get_username(gpi), 3965 purple_proxy_info_get_username(gpi),
3966 purple_proxy_info_get_password(gpi) ? 3966 purple_proxy_info_get_password(gpi) ?
3967 purple_proxy_info_get_password(gpi) : ""); 3967 purple_proxy_info_get_password(gpi) : "");
3968 t2 = purple_base64_encode((const guchar *)t1, strlen(t1)); 3968 t2 = purple_base64_encode((const guchar *)t1, strlen(t1));
3969 g_free(t1); 3969 g_free(t1);
3970 3970
3971 ntlm_type1 = purple_ntlm_gen_type1(hostname, ""); 3971 ntlm_type1 = purple_ntlm_gen_type1(hostname, "");
3972 3972
3973 g_string_append_printf(request_str, 3973 g_string_append_printf(request_str,
3974 "Proxy-Authorization: Basic %s\r\n" 3974 "Proxy-Authorization: Basic %s\r\n"
3975 "Proxy-Authorization: NTLM %s\r\n" 3975 "Proxy-Authorization: NTLM %s\r\n"
3976 "Proxy-Connection: Keep-Alive\r\n", 3976 "Proxy-Connection: Keep-Alive\r\n",
3977 t2, ntlm_type1); 3977 t2, ntlm_type1);