{"thread":{"id":"29922","subject":"[PATCH v4 3/5] http: handle proxy authentication failure (error 407)","startedAt":"2012-03-12T17:27:47Z","lastAt":"2012-03-12T17:27:47Z","messageCount":1,"participants":["Nelson Benitez Leon"],"isPatch":true,"patchVersion":4,"patchTotal":5},"messages":[{"id":"186734","messageId":"4F5E3213.2040008@seap.minhap.es","threadId":"29922","inReplyTo":null,"subject":"[PATCH v4 3/5] http: handle proxy authentication failure (error 407)","fromName":"Nelson Benitez Leon","fromEmail":"nelsonjesus.benitez@seap.minhap.es","sentAt":"2012-03-12T17:27:47Z","receivedAt":"2012-03-12T17:27:47Z","isPatch":true,"sender":{"key":"nelsonjesus.benitez@seap.minhap.es","avatar":null},"body":"Handle http 407 error code by asking for credentials and\nretrying request in case credentials were not present, or\nmarking credentials as rejected if they were already provided.\n\nSigned-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>\n---\n http.c |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex dbdbc3f..14edf5a 100644\n--- a/http.c\n+++ b/http.c\n@@ -825,6 +825,15 @@ static int http_request(const char *url, void *result, int target, int options)\n \t\t\t\tinit_curl_http_auth(slot->curl);\n \t\t\t\tret = HTTP_REAUTH;\n \t\t\t}\n+\t\t} else if (results.http_code == 407) { /* Proxy authentication failure */\n+\t\t\tif (proxy_auth.username && proxy_auth.password) {\n+\t\t\t\tcredential_reject(&proxy_auth);\n+\t\t\t\tret = HTTP_NOAUTH;\n+\t\t\t} else {\n+\t\t\t\tcredential_fill(&proxy_auth);\n+\t\t\t\tset_proxy_auth(slot->curl);\n+\t\t\t\tret = HTTP_REAUTH;\n+\t\t\t}\n \t\t} else {\n \t\t\tif (!curl_errorstr[0])\n \t\t\t\tstrlcpy(curl_errorstr,\n-- \n1.7.7.6\n"}]}