Mercurial > pidgin.yaz
comparison src/proxy.c @ 13698:6bee2e80e42c
[gaim-migrate @ 16101]
Additional constification, add some comments, remove some
superfluous whitespace, and changed gchar to guint8 in a
few places.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 28 Apr 2006 03:52:09 +0000 |
parents | 3eba1e7458c7 |
children | c502ed5ae9f6 |
comparison
equal
deleted
inserted
replaced
13697:89ceef5203ac | 13698:6bee2e80e42c |
---|---|
1205 | 1205 |
1206 /* XXX: why in the hell are we calling gaim_connection_error() here? */ | 1206 /* XXX: why in the hell are we calling gaim_connection_error() here? */ |
1207 if(status == 407 /* Proxy Auth */) { | 1207 if(status == 407 /* Proxy Auth */) { |
1208 gchar *ntlm; | 1208 gchar *ntlm; |
1209 if((ntlm = g_strrstr((const gchar *)phb->read_buffer, "Proxy-Authenticate: NTLM "))) { /* Check for Type-2 */ | 1209 if((ntlm = g_strrstr((const gchar *)phb->read_buffer, "Proxy-Authenticate: NTLM "))) { /* Check for Type-2 */ |
1210 gchar *nonce = ntlm; | 1210 gchar *tmp = ntlm; |
1211 guint8 *nonce; | |
1211 gchar *domain = (gchar*)gaim_proxy_info_get_username(phb->gpi); | 1212 gchar *domain = (gchar*)gaim_proxy_info_get_username(phb->gpi); |
1212 gchar *username; | 1213 gchar *username; |
1213 gchar *request; | 1214 gchar *request; |
1214 gchar *response; | 1215 gchar *response; |
1215 if(!(username = strchr(domain, '\\'))) { | 1216 if(!(username = strchr(domain, '\\'))) { |
1228 return; | 1229 return; |
1229 } | 1230 } |
1230 *username = '\0'; | 1231 *username = '\0'; |
1231 username++; | 1232 username++; |
1232 ntlm += strlen("Proxy-Authenticate: NTLM "); | 1233 ntlm += strlen("Proxy-Authenticate: NTLM "); |
1233 while(*nonce != '\r' && *nonce != '\0') nonce ++; | 1234 while(*tmp != '\r' && *tmp != '\0') tmp++; |
1234 *nonce = '\0'; | 1235 *tmp = '\0'; |
1235 nonce = gaim_ntlm_parse_type2(ntlm, NULL); | 1236 nonce = gaim_ntlm_parse_type2(ntlm, NULL); |
1236 response = gaim_ntlm_gen_type3(username, | 1237 response = gaim_ntlm_gen_type3(username, |
1237 (gchar*) gaim_proxy_info_get_password(phb->gpi), | 1238 (gchar*) gaim_proxy_info_get_password(phb->gpi), |
1238 (gchar*) gaim_proxy_info_get_host(phb->gpi), | 1239 (gchar*) gaim_proxy_info_get_host(phb->gpi), |
1239 domain, nonce, NULL); | 1240 domain, nonce, NULL); |