Mercurial > pidgin
comparison src/proxy.c @ 13312:ce9f249e897b
[gaim-migrate @ 15678]
The HTTP proxy code shouldn't assume that it is being used by an account. This should fix some crashing that was happening for proxy errors.
committer: Tailor Script <tailor@pidgin.im>
| author | Daniel Atallah <daniel.atallah@gmail.com> |
|---|---|
| date | Wed, 22 Feb 2006 00:40:43 +0000 |
| parents | b68897cff861 |
| children | 54f679516b52 |
comparison
equal
deleted
inserted
replaced
| 13311:f6f465b8d1c0 | 13312:ce9f249e897b |
|---|---|
| 1210 gchar *response; | 1210 gchar *response; |
| 1211 if(!(username = strchr(domain, '\\'))) { | 1211 if(!(username = strchr(domain, '\\'))) { |
| 1212 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); | 1212 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); |
| 1213 close(source); | 1213 close(source); |
| 1214 source = -1; | 1214 source = -1; |
| 1215 gaim_connection_error(phb->account->gc, msg); | 1215 if(phb->account) |
| 1216 gaim_connection_error(phb->account->gc, msg); | |
| 1217 else | |
| 1218 gaim_debug_error("http proxy", "%s\n", msg); | |
| 1216 g_free(msg); | 1219 g_free(msg); |
| 1217 gaim_input_remove(phb->inpa); | 1220 gaim_input_remove(phb->inpa); |
| 1218 g_free(phb->read_buffer); | 1221 g_free(phb->read_buffer); |
| 1219 g_free(phb->host); | 1222 g_free(phb->host); |
| 1220 g_free(phb); | 1223 g_free(phb); |
| 1263 int request_len; | 1266 int request_len; |
| 1264 if(!(username = strchr(domain, '\\'))) { | 1267 if(!(username = strchr(domain, '\\'))) { |
| 1265 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); | 1268 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); |
| 1266 close(source); | 1269 close(source); |
| 1267 source = -1; | 1270 source = -1; |
| 1268 gaim_connection_error(phb->account->gc, msg); | 1271 if(phb->account) |
| 1272 gaim_connection_error(phb->account->gc, msg); | |
| 1273 else | |
| 1274 gaim_debug_error("http proxy", "%s\n", msg); | |
| 1269 g_free(msg); | 1275 g_free(msg); |
| 1270 gaim_input_remove(phb->inpa); | 1276 gaim_input_remove(phb->inpa); |
| 1271 g_free(phb->read_buffer); | 1277 g_free(phb->read_buffer); |
| 1272 g_free(phb->host); | 1278 g_free(phb->host); |
| 1273 g_free(phb); | 1279 g_free(phb); |
| 1309 return; | 1315 return; |
| 1310 } else { | 1316 } else { |
| 1311 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); | 1317 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); |
| 1312 close(source); | 1318 close(source); |
| 1313 source = -1; | 1319 source = -1; |
| 1314 gaim_connection_error(phb->account->gc, msg); | 1320 if(phb->account) |
| 1321 gaim_connection_error(phb->account->gc, msg); | |
| 1322 else | |
| 1323 gaim_debug_error("http proxy", "%s\n", msg); | |
| 1315 g_free(msg); | 1324 g_free(msg); |
| 1316 gaim_input_remove(phb->inpa); | 1325 gaim_input_remove(phb->inpa); |
| 1317 g_free(phb->read_buffer); | 1326 g_free(phb->read_buffer); |
| 1318 g_free(phb->host); | 1327 g_free(phb->host); |
| 1319 g_free(phb); | 1328 g_free(phb); |
| 1320 return; | 1329 return; |
| 1321 } | 1330 } |
| 1322 } | 1331 } |
| 1323 if(status == 403 /* Forbidden */ ) { | 1332 if(status == 403 /* Forbidden */ ) { |
| 1324 gchar *msg = g_strdup_printf(_("Access denied: proxy server forbids port %d tunnelling."), phb->port); | 1333 gchar *msg = g_strdup_printf(_("Access denied: proxy server forbids port %d tunnelling."), phb->port); |
| 1325 gaim_connection_error(phb->account->gc, msg); | 1334 if(phb->account) |
| 1335 gaim_connection_error(phb->account->gc, msg); | |
| 1336 else | |
| 1337 gaim_debug_error("http proxy", "%s\n", msg); | |
| 1326 g_free(msg); | 1338 g_free(msg); |
| 1327 gaim_input_remove(phb->inpa); | 1339 gaim_input_remove(phb->inpa); |
| 1328 g_free(phb->read_buffer); | 1340 g_free(phb->read_buffer); |
| 1329 g_free(phb->host); | 1341 g_free(phb->host); |
| 1330 g_free(phb); | 1342 g_free(phb); |
| 1331 } else { | 1343 } else { |
| 1332 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); | 1344 char *msg = g_strdup_printf(_("Proxy connection error %d"), status); |
| 1333 gaim_connection_error(phb->account->gc, msg); | 1345 if(phb->account) |
| 1346 gaim_connection_error(phb->account->gc, msg); | |
| 1347 else | |
| 1348 gaim_debug_error("http proxy", "%s\n", msg); | |
| 1334 g_free(msg); | 1349 g_free(msg); |
| 1335 gaim_input_remove(phb->inpa); | 1350 gaim_input_remove(phb->inpa); |
| 1336 g_free(phb->read_buffer); | 1351 g_free(phb->read_buffer); |
| 1337 g_free(phb->host); | 1352 g_free(phb->host); |
| 1338 g_free(phb); | 1353 g_free(phb); |
