[librest] Avoid infinite loop with wrong HTTP credentials
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librest] Avoid infinite loop with wrong HTTP credentials
- Date: Thu, 7 Jun 2012 09:47:57 +0000 (UTC)
commit d2e81c42c766a8d2502dbcf59ec21fd0c22a1369
Author: Christophe Fergeau <cfergeau redhat com>
Date: Wed Jun 6 18:30:06 2012 +0200
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
rest/rest-proxy.c | 3 ++-
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]