summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-11-06 22:31:50 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2010-11-06 22:31:50 (GMT)
commit3409797d10c2834e57383b2bfd5b27a0ab3dc9f3 (patch)
treeba8fe6a6e3acc74707aeb07735870770f1c16ea8
parent67be5b135672e6371df23efe7b7e44f405043e00 (diff)
downloadconnman-3409797d10c2834e57383b2bfd5b27a0ab3dc9f3.zip
connman-3409797d10c2834e57383b2bfd5b27a0ab3dc9f3.tar.gz
connman-3409797d10c2834e57383b2bfd5b27a0ab3dc9f3.tar.bz2
Add interface for setting proxy for GWeb sessions
-rw-r--r--gweb/gweb.c15
-rw-r--r--gweb/gweb.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/gweb/gweb.c b/gweb/gweb.c
index b0bad59..7b52098 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -99,6 +99,7 @@ struct _GWeb {
GList *session_list;
GResolv *resolv;
+ char *proxy;
char *accept_option;
char *user_agent;
gboolean close_connection;
@@ -219,8 +220,11 @@ void g_web_unref(GWeb *web)
g_resolv_unref(web->resolv);
+ g_free(web->proxy);
+
g_free(web->accept_option);
g_free(web->user_agent);
+
g_free(web);
}
@@ -235,6 +239,17 @@ void g_web_set_debug(GWeb *web, GWebDebugFunc func, gpointer user_data)
g_resolv_set_debug(web->resolv, func, user_data);
}
+gboolean g_web_set_proxy(GWeb *web, const char *proxy)
+{
+ if (web == NULL)
+ return FALSE;
+
+ g_free(web->proxy);
+ web->proxy = g_strdup(proxy);
+
+ return TRUE;
+}
+
gboolean g_web_add_nameserver(GWeb *web, const char *address)
{
if (web == NULL)
diff --git a/gweb/gweb.h b/gweb/gweb.h
index fa6a897..bf05fa5 100644
--- a/gweb/gweb.h
+++ b/gweb/gweb.h
@@ -52,6 +52,8 @@ void g_web_unref(GWeb *web);
void g_web_set_debug(GWeb *web, GWebDebugFunc func, gpointer user_data);
+gboolean g_web_set_proxy(GWeb *web, const char *proxy);
+
gboolean g_web_add_nameserver(GWeb *web, const char *address);
gboolean g_web_set_accept(GWeb *web, const char *format, ...)