[libsoup] Do not try to resolve URIs without a host
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Do not try to resolve URIs without a host
- Date: Sat, 3 Apr 2010 17:24:59 +0000 (UTC)
commit 50e363db0243cd94acd45e67f93983312a90eb1c
Author: Xan Lopez <xan gnome org>
Date: Sat Mar 20 23:29:03 2010 +0200
Do not try to resolve URIs without a host
WebKit feeds to us URIs without any host whatsoever (for example,
javascript: URIs), which make libsoup spew a lot of runtime warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=613442
libsoup/soup-session.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 59342e9..4068804 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1781,10 +1781,18 @@ soup_session_abort (SoupSession *session)
void
soup_session_prepare_for_uri (SoupSession *session, SoupURI *uri)
{
- SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
+ SoupSessionPrivate *priv;
SoupSessionHost *host;
SoupAddress *addr;
+ g_return_if_fail (SOUP_IS_SESSION (session));
+ g_return_if_fail (uri != NULL);
+
+ if (!uri->host)
+ return;
+
+ priv = SOUP_SESSION_GET_PRIVATE (session);
+
g_mutex_lock (priv->host_lock);
host = get_host_for_uri (session, uri);
addr = g_object_ref (host->addr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]