mshtml(1/2): Use a helper to set the proxy server and port

Juan Lang juan.lang at gmail.com
Fri Aug 21 12:35:20 CDT 2009


--Juan
-------------- next part --------------
From 422e6d217ceda0199a5a731ebad2d4dfe8ab5f45 Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Fri, 21 Aug 2009 10:26:33 -0700
Subject: [PATCH 3/4] Use a helper to set the proxy server and port

---
 dlls/mshtml/nsembed.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index 41f762f..1ce5607 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -350,6 +350,19 @@ static void set_lang(nsIPrefBranch *pref)
     set_string_pref(pref, "intl.accept_languages", langs);
 }
 
+static void set_proxy_host_and_port(nsIPrefBranch *pref, const char *proxy,
+        int proxy_port_num)
+{
+    TRACE("Setting proxy to %s, port %d\n", debugstr_a(proxy), proxy_port_num);
+
+    set_string_pref(pref, "network.proxy.http", proxy);
+    set_string_pref(pref, "network.proxy.ssl", proxy);
+
+    set_int_pref(pref, "network.proxy.type", 1);
+    set_int_pref(pref, "network.proxy.http_port", proxy_port_num);
+    set_int_pref(pref, "network.proxy.ssl_port", proxy_port_num);
+}
+
 static void set_proxy(nsIPrefBranch *pref)
 {
     char proxy[512];
@@ -389,14 +402,7 @@ static void set_proxy(nsIPrefBranch *pref)
 
     *proxy_port = 0;
     proxy_port_num = atoi(proxy_port + 1);
-    TRACE("Setting proxy to %s, port %d\n", debugstr_a(proxy), proxy_port_num);
-
-    set_string_pref(pref, "network.proxy.http", proxy);
-    set_string_pref(pref, "network.proxy.ssl", proxy);
-
-    set_int_pref(pref, "network.proxy.type", 1);
-    set_int_pref(pref, "network.proxy.http_port", proxy_port_num);
-    set_int_pref(pref, "network.proxy.ssl_port", proxy_port_num);
+    set_proxy_host_and_port(pref, proxy, proxy_port_num);
 }
 
 static void set_preferences(void)
-- 
1.6.3.2


More information about the wine-patches mailing list