summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-06-06 18:30:06 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2012-06-07 11:47:01 +0200
commitd2e81c42c766a8d2502dbcf59ec21fd0c22a1369 (patch)
tree32b22ce906b130ed0227f63ba2c184c4750b10bc
parentcbb7ff2a3789e0893dbd2eee350edc4cef26faa2 (diff)
downloadlibrest-d2e81c42c766a8d2502dbcf59ec21fd0c22a1369.tar.gz
Avoid infinite loop with wrong HTTP credentials
When provided with wrong credentials, libsoup will try to connect and emit its 'authenticate' signal as long as its callback calls soup_auth_authenticate. It will fail the request and report to the caller if this function is not called. Since the 'retrying' parameter to the 'authenticate' callback lets us know when the credentials we provided are the wrong ones, this commit makes sure we stop calling soup_auth_authenticate after trying the credentials once. Without this, libsoup will try the same request again and again without ever returning when provided with wrong credentials. https://bugzilla.gnome.org/show_bug.cgi?id=658937
-rw-r--r--rest/rest-proxy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c
index 4ac8375..b23d29e 100644
--- a/rest/rest-proxy.c
+++ b/rest/rest-proxy.c
@@ -183,7 +183,8 @@ authenticate (RestProxy *self,
{
RestProxyPrivate *priv = GET_PRIVATE (self);
- soup_auth_authenticate (auth, priv->username, priv->password);
+ if (!retrying)
+ soup_auth_authenticate (auth, priv->username, priv->password);
}
static void