Fri, 18 Dec 2020 01:39:20 -0600
Remove proxy connection code.
Testing Done:
Compile only; everything that uses it's been removed already.
Reviewed at https://reviews.imfreedom.org/r/283/
| 37460 | 1 | /* purple |
| 1 | 2 | * |
| 15884 | 3 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 1 | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19840
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 1 | 20 | * |
| 21 | */ | |
| 22 | ||
|
40441
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40058
diff
changeset
|
23 | #include <glib/gi18n-lib.h> |
|
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40058
diff
changeset
|
24 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
25 | #include "internal.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
26 | #include "debug.h" |
|
6621
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
27 | #include "notify.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
28 | #include "prefs.h" |
| 1 | 29 | #include "proxy.h" |
|
37964
39fca28f1a6e
proxy: Use new purple_gio_socket_client_new() helper function
Mike Ruprecht <cmaiku@gmail.com>
parents:
37942
diff
changeset
|
30 | #include "purple-gio.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
31 | #include "util.h" |
| 3630 | 32 | |
|
37451
927a083a6c9f
This probably doesn't work, but it compiles (for now)
Gary Kramlich <grim@reaperworld.com>
parents:
37193
diff
changeset
|
33 | #include <gio/gio.h> |
|
39990
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
34 | #include <libsoup/soup.h> |
|
37451
927a083a6c9f
This probably doesn't work, but it compiles (for now)
Gary Kramlich <grim@reaperworld.com>
parents:
37193
diff
changeset
|
35 | |
|
32299
106311e19d3a
Hide PurpleProxyInfo struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32297
diff
changeset
|
36 | struct _PurpleProxyInfo |
|
106311e19d3a
Hide PurpleProxyInfo struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32297
diff
changeset
|
37 | { |
|
35462
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
38 | PurpleProxyType type; /* The proxy type. */ |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
39 | |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
40 | char *host; /* The host. */ |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
41 | int port; /* The port number. */ |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
42 | char *username; /* The username. */ |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
43 | char *password; /* The password. */ |
|
32299
106311e19d3a
Hide PurpleProxyInfo struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32297
diff
changeset
|
44 | }; |
|
106311e19d3a
Hide PurpleProxyInfo struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32297
diff
changeset
|
45 | |
| 15884 | 46 | static PurpleProxyInfo *global_proxy_info = NULL; |
|
14165
0f09ac2220f4
[gaim-migrate @ 16734]
Mark Doliner <markdoliner@pidgin.im>
parents:
14161
diff
changeset
|
47 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
48 | /************************************************************************** |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
49 | * Proxy structure API |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
50 | **************************************************************************/ |
| 15884 | 51 | PurpleProxyInfo * |
| 52 | purple_proxy_info_new(void) | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
53 | { |
| 15884 | 54 | return g_new0(PurpleProxyInfo, 1); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
55 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
56 | |
|
39386
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
57 | static PurpleProxyInfo * |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
58 | purple_proxy_info_copy(PurpleProxyInfo *info) |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
59 | { |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
60 | PurpleProxyInfo *copy; |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
61 | |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
62 | g_return_val_if_fail(info != NULL, NULL); |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
63 | |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
64 | copy = purple_proxy_info_new(); |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
65 | copy->type = info->type; |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
66 | copy->host = g_strdup(info->host); |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
67 | copy->port = info->port; |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
68 | copy->username = g_strdup(info->username); |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
69 | copy->password = g_strdup(info->password); |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
70 | |
|
39462
1fcf9a1f920e
Fix broken PurpleProxyInfo copying.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39386
diff
changeset
|
71 | return copy; |
|
39386
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
72 | } |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
73 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
74 | void |
| 15884 | 75 | purple_proxy_info_destroy(PurpleProxyInfo *info) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
76 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
77 | g_return_if_fail(info != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
78 | |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13991
diff
changeset
|
79 | g_free(info->host); |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13991
diff
changeset
|
80 | g_free(info->username); |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13991
diff
changeset
|
81 | g_free(info->password); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
82 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
83 | g_free(info); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
84 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
85 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
86 | void |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
87 | purple_proxy_info_set_proxy_type(PurpleProxyInfo *info, PurpleProxyType type) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
88 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
89 | g_return_if_fail(info != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
90 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
91 | info->type = type; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
92 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
93 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
94 | void |
| 15884 | 95 | purple_proxy_info_set_host(PurpleProxyInfo *info, const char *host) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
96 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
97 | g_return_if_fail(info != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
98 | |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13991
diff
changeset
|
99 | g_free(info->host); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14030
diff
changeset
|
100 | info->host = g_strdup(host); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
101 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
102 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
103 | void |
| 15884 | 104 | purple_proxy_info_set_port(PurpleProxyInfo *info, int port) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
105 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
106 | g_return_if_fail(info != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
107 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
108 | info->port = port; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
109 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
110 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
111 | void |
| 15884 | 112 | purple_proxy_info_set_username(PurpleProxyInfo *info, const char *username) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
113 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
114 | g_return_if_fail(info != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
115 | |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13991
diff
changeset
|
116 | g_free(info->username); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14030
diff
changeset
|
117 | info->username = g_strdup(username); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
118 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
119 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
120 | void |
| 15884 | 121 | purple_proxy_info_set_password(PurpleProxyInfo *info, const char *password) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
122 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
123 | g_return_if_fail(info != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
124 | |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13991
diff
changeset
|
125 | g_free(info->password); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14030
diff
changeset
|
126 | info->password = g_strdup(password); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
127 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
128 | |
| 15884 | 129 | PurpleProxyType |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
130 | purple_proxy_info_get_proxy_type(const PurpleProxyInfo *info) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
131 | { |
| 15884 | 132 | g_return_val_if_fail(info != NULL, PURPLE_PROXY_NONE); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
133 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
134 | return info->type; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
135 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
136 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
137 | const char * |
| 15884 | 138 | purple_proxy_info_get_host(const PurpleProxyInfo *info) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
139 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
140 | g_return_val_if_fail(info != NULL, NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
141 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
142 | return info->host; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
143 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
144 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
145 | int |
| 15884 | 146 | purple_proxy_info_get_port(const PurpleProxyInfo *info) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
147 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
148 | g_return_val_if_fail(info != NULL, 0); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
149 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
150 | return info->port; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
151 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
152 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
153 | const char * |
| 15884 | 154 | purple_proxy_info_get_username(const PurpleProxyInfo *info) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
155 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
156 | g_return_val_if_fail(info != NULL, NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
157 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
158 | return info->username; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
159 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
160 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
161 | const char * |
| 15884 | 162 | purple_proxy_info_get_password(const PurpleProxyInfo *info) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
163 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
164 | g_return_val_if_fail(info != NULL, NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
165 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
166 | return info->password; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
167 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
168 | |
|
39386
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
169 | G_DEFINE_BOXED_TYPE(PurpleProxyInfo, purple_proxy_info, |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
170 | purple_proxy_info_copy, purple_proxy_info_destroy); |
|
3fd7e834749f
libpurple: Make PurpleProxyInfo a boxed type
Mike Ruprecht <cmaiku@gmail.com>
parents:
38356
diff
changeset
|
171 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
172 | /************************************************************************** |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
173 | * Global Proxy API |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
174 | **************************************************************************/ |
| 15884 | 175 | PurpleProxyInfo * |
| 176 | purple_global_proxy_get_info(void) | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
177 | { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
178 | return global_proxy_info; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
179 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
180 | |
|
25858
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
181 | void |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
182 | purple_global_proxy_set_info(PurpleProxyInfo *info) |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
183 | { |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
184 | g_return_if_fail(info != NULL); |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
185 | |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
186 | purple_proxy_info_destroy(global_proxy_info); |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
187 | |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
188 | global_proxy_info = info; |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
189 | } |
|
ec60fbe5a4ab
Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents:
24866
diff
changeset
|
190 | |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
191 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
192 | /* index in gproxycmds below, keep them in sync */ |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
193 | #define GNOME_PROXY_MODE 0 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
194 | #define GNOME_PROXY_USE_SAME_PROXY 1 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
195 | #define GNOME_PROXY_SOCKS_HOST 2 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
196 | #define GNOME_PROXY_SOCKS_PORT 3 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
197 | #define GNOME_PROXY_HTTP_HOST 4 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
198 | #define GNOME_PROXY_HTTP_PORT 5 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
199 | #define GNOME_PROXY_HTTP_USER 6 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
200 | #define GNOME_PROXY_HTTP_PASS 7 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
201 | #define GNOME2_CMDS 0 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
202 | #define GNOME3_CMDS 1 |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
203 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
204 | /* detect proxy settings for gnome2/gnome3 */ |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
205 | static const char* gproxycmds[][2] = { |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
206 | { "gconftool-2 -g /system/proxy/mode" , "gsettings get org.gnome.system.proxy mode" }, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
207 | { "gconftool-2 -g /system/http_proxy/use_same_proxy", "gsettings get org.gnome.system.proxy use-same-proxy" }, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
208 | { "gconftool-2 -g /system/proxy/socks_host", "gsettings get org.gnome.system.proxy.socks host" }, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
209 | { "gconftool-2 -g /system/proxy/socks_port", "gsettings get org.gnome.system.proxy.socks port" }, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
210 | { "gconftool-2 -g /system/http_proxy/host", "gsettings get org.gnome.system.proxy.http host" }, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
211 | { "gconftool-2 -g /system/http_proxy/port", "gsettings get org.gnome.system.proxy.http port"}, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
212 | { "gconftool-2 -g /system/http_proxy/authentication_user", "gsettings get org.gnome.system.proxy.http authentication-user" }, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
213 | { "gconftool-2 -g /system/http_proxy/authentication_password", "gsettings get org.gnome.system.proxy.http authentication-password" }, |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
214 | }; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
215 | |
|
35462
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
216 | /* |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
217 | * purple_gnome_proxy_get_parameter: |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
218 | * @parameter: One of the GNOME_PROXY_x constants defined above |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
219 | * @gnome_version: GNOME2_CMDS or GNOME3_CMDS |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
220 | * |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
221 | * This is a utility function used to retrieve proxy parameter values from |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
222 | * GNOME 2/3 environment. |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
223 | * |
|
35462
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
224 | * Returns: The value of requested proxy parameter |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
225 | */ |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
226 | static char * |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
227 | purple_gnome_proxy_get_parameter(guint8 parameter, guint8 gnome_version) |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
228 | { |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
229 | gchar *param, *err; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
230 | size_t param_len; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
231 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
232 | if (parameter > GNOME_PROXY_HTTP_PASS) |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
233 | return NULL; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
234 | if (gnome_version > GNOME3_CMDS) |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
235 | return NULL; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
236 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
237 | if (!g_spawn_command_line_sync(gproxycmds[parameter][gnome_version], |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
238 | ¶m, &err, NULL, NULL)) |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
239 | return NULL; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
240 | g_free(err); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
241 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
242 | g_strstrip(param); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
243 | if (param[0] == '\'' || param[0] == '\"') { |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
244 | param_len = strlen(param); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
245 | memmove(param, param + 1, param_len); /* copy last \0 too */ |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
246 | --param_len; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
247 | if (param_len > 0 && (param[param_len - 1] == '\'' || param[param_len - 1] == '\"')) |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
248 | param[param_len - 1] = '\0'; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
249 | g_strstrip(param); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
250 | } |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
251 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
252 | return param; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
253 | } |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
254 | |
| 15884 | 255 | static PurpleProxyInfo * |
| 256 | purple_gnome_proxy_get_info(void) | |
| 11878 | 257 | { |
| 15884 | 258 | static PurpleProxyInfo info = {0, NULL, 0, NULL, NULL}; |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
259 | gboolean use_same_proxy = FALSE; |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
260 | gchar *tmp; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
261 | guint8 gnome_version = GNOME3_CMDS; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
262 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
263 | tmp = g_find_program_in_path("gsettings"); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
264 | if (tmp == NULL) { |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
265 | tmp = g_find_program_in_path("gconftool-2"); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
266 | gnome_version = GNOME2_CMDS; |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
267 | } |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
268 | if (tmp == NULL) |
|
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
269 | return purple_global_proxy_get_info(); |
|
12156
58a027264d6c
[gaim-migrate @ 14457]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11878
diff
changeset
|
270 | |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
271 | g_free(tmp); |
|
12156
58a027264d6c
[gaim-migrate @ 14457]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11878
diff
changeset
|
272 | |
|
22555
04cfb0cf0974
Improve our error handling of Gnome proxy settings.
Mark Doliner <markdoliner@pidgin.im>
parents:
22554
diff
changeset
|
273 | /* Check whether to use a proxy. */ |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
274 | tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_MODE, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
275 | if (!tmp) |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
276 | return purple_global_proxy_get_info(); |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
277 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
278 | if (purple_strequal(tmp, "none")) { |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
279 | info.type = PURPLE_PROXY_NONE; |
|
12156
58a027264d6c
[gaim-migrate @ 14457]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11878
diff
changeset
|
280 | g_free(tmp); |
| 11878 | 281 | return &info; |
| 282 | } | |
|
22555
04cfb0cf0974
Improve our error handling of Gnome proxy settings.
Mark Doliner <markdoliner@pidgin.im>
parents:
22554
diff
changeset
|
283 | |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
284 | if (!purple_strequal(tmp, "manual")) { |
|
22555
04cfb0cf0974
Improve our error handling of Gnome proxy settings.
Mark Doliner <markdoliner@pidgin.im>
parents:
22554
diff
changeset
|
285 | /* Unknown setting. Fallback to using our global proxy settings. */ |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
286 | g_free(tmp); |
|
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
287 | return purple_global_proxy_get_info(); |
|
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
288 | } |
|
12156
58a027264d6c
[gaim-migrate @ 14457]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11878
diff
changeset
|
289 | |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
290 | g_free(tmp); |
|
22555
04cfb0cf0974
Improve our error handling of Gnome proxy settings.
Mark Doliner <markdoliner@pidgin.im>
parents:
22554
diff
changeset
|
291 | |
|
22560
510c8edb3854
Bring back the lines that free info.whatever on subsequent calls to
Mark Doliner <markdoliner@pidgin.im>
parents:
22559
diff
changeset
|
292 | /* Free the old fields */ |
|
37426
6fd4989b77e4
The last of the NULL-checks before free()
Michael McConville <mmcco@mykolab.com>
parents:
37193
diff
changeset
|
293 | g_free(info.host); |
|
6fd4989b77e4
The last of the NULL-checks before free()
Michael McConville <mmcco@mykolab.com>
parents:
37193
diff
changeset
|
294 | info.host = NULL; |
|
6fd4989b77e4
The last of the NULL-checks before free()
Michael McConville <mmcco@mykolab.com>
parents:
37193
diff
changeset
|
295 | g_free(info.username); |
|
6fd4989b77e4
The last of the NULL-checks before free()
Michael McConville <mmcco@mykolab.com>
parents:
37193
diff
changeset
|
296 | info.username = NULL; |
|
6fd4989b77e4
The last of the NULL-checks before free()
Michael McConville <mmcco@mykolab.com>
parents:
37193
diff
changeset
|
297 | g_free(info.password); |
|
6fd4989b77e4
The last of the NULL-checks before free()
Michael McConville <mmcco@mykolab.com>
parents:
37193
diff
changeset
|
298 | info.password = NULL; |
|
22560
510c8edb3854
Bring back the lines that free info.whatever on subsequent calls to
Mark Doliner <markdoliner@pidgin.im>
parents:
22559
diff
changeset
|
299 | |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
300 | tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_USE_SAME_PROXY, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
301 | if (!tmp) |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
302 | return purple_global_proxy_get_info(); |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
303 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
304 | if (purple_strequal(tmp, "true")) |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
305 | use_same_proxy = TRUE; |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
306 | |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
307 | g_free(tmp); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
308 | |
|
24315
98e4a5f1d662
Fix a double free. Fixes #7047
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
24298
diff
changeset
|
309 | if (!use_same_proxy) { |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
310 | info.host = purple_gnome_proxy_get_parameter(GNOME_PROXY_SOCKS_HOST, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
311 | if (!info.host) |
|
24315
98e4a5f1d662
Fix a double free. Fixes #7047
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
24298
diff
changeset
|
312 | return purple_global_proxy_get_info(); |
|
98e4a5f1d662
Fix a double free. Fixes #7047
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
24298
diff
changeset
|
313 | } |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
314 | |
|
24315
98e4a5f1d662
Fix a double free. Fixes #7047
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
24298
diff
changeset
|
315 | if (!use_same_proxy && (info.host != NULL) && (*info.host != '\0')) { |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
316 | info.type = PURPLE_PROXY_SOCKS5; |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
317 | tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_SOCKS_PORT, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
318 | if (!tmp) { |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
319 | g_free(info.host); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
320 | info.host = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
321 | return purple_global_proxy_get_info(); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
322 | } |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
323 | info.port = atoi(tmp); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
324 | g_free(tmp); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
325 | } else { |
|
22555
04cfb0cf0974
Improve our error handling of Gnome proxy settings.
Mark Doliner <markdoliner@pidgin.im>
parents:
22554
diff
changeset
|
326 | g_free(info.host); |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
327 | info.host = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_HOST, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
328 | if (!info.host) |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
329 | return purple_global_proxy_get_info(); |
|
24316
88c65c05a21e
Some minor cleanup; removal of unnecessary frees and setting stuff to NULL
Daniel Atallah <datallah@pidgin.im>
parents:
24315
diff
changeset
|
330 | |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
331 | /* If we get this far then we know we're using an HTTP proxy */ |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
332 | info.type = PURPLE_PROXY_HTTP; |
| 11878 | 333 | |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
334 | if (*info.host == '\0') |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
335 | { |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
336 | purple_debug_info("proxy", "Gnome proxy settings are set to " |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
337 | "'manual' but no suitable proxy server is specified. Using " |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
338 | "Pidgin's proxy settings instead.\n"); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
339 | g_free(info.host); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
340 | info.host = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
341 | return purple_global_proxy_get_info(); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
342 | } |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
343 | |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
344 | info.username = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_USER, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
345 | if (!info.username) |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
346 | { |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
347 | g_free(info.host); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
348 | info.host = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
349 | return purple_global_proxy_get_info(); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
350 | } |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
351 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
352 | info.password = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_PASS, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
353 | if (!info.password) |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
354 | { |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
355 | g_free(info.host); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
356 | info.host = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
357 | g_free(info.username); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
358 | info.username = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
359 | return purple_global_proxy_get_info(); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
360 | } |
|
32136
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
361 | |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
362 | tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_PORT, gnome_version); |
|
98a6cc751323
Add support for reading GNOME3 proxy settings.
Mihai Serban <mihai.serban@gmail.com>
parents:
32129
diff
changeset
|
363 | if (!tmp) |
|
24156
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
364 | { |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
365 | g_free(info.host); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
366 | info.host = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
367 | g_free(info.username); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
368 | info.username = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
369 | g_free(info.password); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
370 | info.password = NULL; |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
371 | return purple_global_proxy_get_info(); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
372 | } |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
373 | info.port = atoi(tmp); |
|
6c7631ae7571
Use SOCKS proxy if specified when running in GNOME
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23532
diff
changeset
|
374 | g_free(tmp); |
|
22555
04cfb0cf0974
Improve our error handling of Gnome proxy settings.
Mark Doliner <markdoliner@pidgin.im>
parents:
22554
diff
changeset
|
375 | } |
| 11878 | 376 | |
|
22554
dff2ca00b045
Short circuit and return out of the function early if gconftool-2
Mark Doliner <markdoliner@pidgin.im>
parents:
22553
diff
changeset
|
377 | return &info; |
| 11878 | 378 | } |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
379 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
380 | #ifdef _WIN32 |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
381 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
382 | typedef BOOL (CALLBACK* LPFNWINHTTPGETIEPROXYCONFIG)(/*IN OUT*/ WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* pProxyConfig); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
383 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
384 | /* This modifies "host" in-place evilly */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
385 | static void |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
386 | _proxy_fill_hostinfo(PurpleProxyInfo *info, char *host, int default_port) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
387 | { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
388 | int port = default_port; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
389 | char *d; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
390 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
391 | d = g_strrstr(host, ":"); |
|
30057
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
392 | if (d) { |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
393 | *d = '\0'; |
|
30057
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
394 | |
|
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
395 | d++; |
|
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
396 | if (*d) |
|
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
397 | sscanf(d, "%d", &port); |
|
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
398 | |
|
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
399 | if (port == 0) |
|
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
400 | port = default_port; |
|
ab9790d588f9
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Marten Klencke <mklencke@gmx.net>
parents:
29365
diff
changeset
|
401 | } |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
402 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
403 | purple_proxy_info_set_host(info, host); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
404 | purple_proxy_info_set_port(info, port); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
405 | } |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
406 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
407 | static PurpleProxyInfo * |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
408 | purple_win32_proxy_get_info(void) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
409 | { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
410 | static LPFNWINHTTPGETIEPROXYCONFIG MyWinHttpGetIEProxyConfig = NULL; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
411 | static gboolean loaded = FALSE; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
412 | static PurpleProxyInfo info = {0, NULL, 0, NULL, NULL}; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
413 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
414 | WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_proxy_config; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
415 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
416 | if (!loaded) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
417 | loaded = TRUE; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
418 | MyWinHttpGetIEProxyConfig = (LPFNWINHTTPGETIEPROXYCONFIG) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
419 | wpurple_find_and_loadproc("winhttp.dll", "WinHttpGetIEProxyConfigForCurrentUser"); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
420 | if (!MyWinHttpGetIEProxyConfig) |
|
27497
2dc5a0e0c4c2
Increase the logging level of some debugging messages that seemed to be a
Mauro Brasil <mauro.brasil@tqi.com.br>
parents:
27249
diff
changeset
|
421 | purple_debug_warning("proxy", "Unable to read Windows Proxy Settings.\n"); |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
422 | } |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
423 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
424 | if (!MyWinHttpGetIEProxyConfig) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
425 | return NULL; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
426 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
427 | ZeroMemory(&ie_proxy_config, sizeof(ie_proxy_config)); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
428 | if (!MyWinHttpGetIEProxyConfig(&ie_proxy_config)) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
429 | purple_debug_error("proxy", "Error reading Windows Proxy Settings(%lu).\n", GetLastError()); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
430 | return NULL; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
431 | } |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
432 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
433 | /* We can't do much if it is autodetect*/ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
434 | if (ie_proxy_config.fAutoDetect) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
435 | purple_debug_error("proxy", "Windows Proxy Settings set to autodetect (not supported).\n"); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
436 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
437 | /* TODO: For 3.0.0 we'll revisit this (maybe)*/ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
438 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
439 | return NULL; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
440 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
441 | } else if (ie_proxy_config.lpszProxy) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
442 | gchar *proxy_list = g_utf16_to_utf8(ie_proxy_config.lpszProxy, -1, |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
443 | NULL, NULL, NULL); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
444 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
445 | /* We can't do anything about the bypass list, as we don't have the url */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
446 | /* TODO: For 3.0.0 we'll revisit this*/ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
447 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
448 | /* There are proxy settings for several protocols */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
449 | if (proxy_list && *proxy_list) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
450 | char *specific = NULL, *tmp; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
451 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
452 | /* If there is only a global proxy, which means "HTTP" */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
453 | if (!strchr(proxy_list, ';') || (specific = g_strstr_len(proxy_list, -1, "http=")) != NULL) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
454 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
455 | if (specific) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
456 | specific += strlen("http="); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
457 | tmp = strchr(specific, ';'); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
458 | if (tmp) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
459 | *tmp = '\0'; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
460 | /* specific now points the proxy server (and port) */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
461 | } else |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
462 | specific = proxy_list; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
463 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
464 | purple_proxy_info_set_proxy_type(&info, PURPLE_PROXY_HTTP); |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
465 | _proxy_fill_hostinfo(&info, specific, 80); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
466 | /* TODO: is there a way to set the username/password? */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
467 | purple_proxy_info_set_username(&info, NULL); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
468 | purple_proxy_info_set_password(&info, NULL); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
469 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
470 | purple_debug_info("proxy", "Windows Proxy Settings: HTTP proxy: '%s:%d'.\n", |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
471 | purple_proxy_info_get_host(&info), |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
472 | purple_proxy_info_get_port(&info)); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
473 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
474 | } else if ((specific = g_strstr_len(proxy_list, -1, "socks=")) != NULL) { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
475 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
476 | specific += strlen("socks="); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
477 | tmp = strchr(specific, ';'); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
478 | if (tmp) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
479 | *tmp = '\0'; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
480 | /* specific now points the proxy server (and port) */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
481 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
482 | purple_proxy_info_set_proxy_type(&info, PURPLE_PROXY_SOCKS5); |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
483 | _proxy_fill_hostinfo(&info, specific, 1080); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
484 | /* TODO: is there a way to set the username/password? */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
485 | purple_proxy_info_set_username(&info, NULL); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
486 | purple_proxy_info_set_password(&info, NULL); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
487 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
488 | purple_debug_info("proxy", "Windows Proxy Settings: SOCKS5 proxy: '%s:%d'.\n", |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
489 | purple_proxy_info_get_host(&info), |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
490 | purple_proxy_info_get_port(&info)); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
491 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
492 | } else { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
493 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
494 | purple_debug_info("proxy", "Windows Proxy Settings: No supported proxy specified.\n"); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
495 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
496 | purple_proxy_info_set_proxy_type(&info, PURPLE_PROXY_NONE); |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
497 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
498 | } |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
499 | } |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
500 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
501 | /* TODO: Fix API to be able look at proxy bypass settings */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
502 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
503 | g_free(proxy_list); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
504 | } else { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
505 | purple_debug_info("proxy", "No Windows proxy set.\n"); |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
506 | purple_proxy_info_set_proxy_type(&info, PURPLE_PROXY_NONE); |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
507 | } |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
508 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
509 | if (ie_proxy_config.lpszAutoConfigUrl) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
510 | GlobalFree(ie_proxy_config.lpszAutoConfigUrl); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
511 | if (ie_proxy_config.lpszProxy) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
512 | GlobalFree(ie_proxy_config.lpszProxy); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
513 | if (ie_proxy_config.lpszProxyBypass) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
514 | GlobalFree(ie_proxy_config.lpszProxyBypass); |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
515 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
516 | return &info; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
517 | } |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
518 | #endif |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
519 | |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
520 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
521 | /************************************************************************** |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
522 | * Proxy API |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
523 | **************************************************************************/ |
|
4366
d2b52a5ff6fc
[gaim-migrate @ 4632]
Nicolás Lichtmaier <nico@lichtmaier.com.ar>
parents:
3867
diff
changeset
|
524 | |
| 15884 | 525 | PurpleProxyInfo * |
| 526 | purple_proxy_get_setup(PurpleAccount *account) | |
|
1087
bc9c6b635358
[gaim-migrate @ 1097]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1057
diff
changeset
|
527 | { |
| 15884 | 528 | PurpleProxyInfo *gpi = NULL; |
|
6621
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
529 | const gchar *tmp; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
530 | |
|
15032
65a111aba7a8
[gaim-migrate @ 17749]
Daniel Atallah <datallah@pidgin.im>
parents:
15015
diff
changeset
|
531 | /* This is used as a fallback so we don't overwrite the selected proxy type */ |
| 15884 | 532 | static PurpleProxyInfo *tmp_none_proxy_info = NULL; |
|
15032
65a111aba7a8
[gaim-migrate @ 17749]
Daniel Atallah <datallah@pidgin.im>
parents:
15015
diff
changeset
|
533 | if (!tmp_none_proxy_info) { |
| 15884 | 534 | tmp_none_proxy_info = purple_proxy_info_new(); |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
535 | purple_proxy_info_set_proxy_type(tmp_none_proxy_info, PURPLE_PROXY_NONE); |
|
15032
65a111aba7a8
[gaim-migrate @ 17749]
Daniel Atallah <datallah@pidgin.im>
parents:
15015
diff
changeset
|
536 | } |
|
65a111aba7a8
[gaim-migrate @ 17749]
Daniel Atallah <datallah@pidgin.im>
parents:
15015
diff
changeset
|
537 | |
| 15884 | 538 | if (account && purple_account_get_proxy_info(account) != NULL) { |
| 539 | gpi = purple_account_get_proxy_info(account); | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
540 | if (purple_proxy_info_get_proxy_type(gpi) == PURPLE_PROXY_USE_GLOBAL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
15032
diff
changeset
|
541 | gpi = NULL; |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
15032
diff
changeset
|
542 | } |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
15032
diff
changeset
|
543 | if (gpi == NULL) { |
| 15884 | 544 | if (purple_running_gnome()) |
| 545 | gpi = purple_gnome_proxy_get_info(); | |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
15032
diff
changeset
|
546 | else |
| 15884 | 547 | gpi = purple_global_proxy_get_info(); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
15032
diff
changeset
|
548 | } |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
549 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
550 | if (purple_proxy_info_get_proxy_type(gpi) == PURPLE_PROXY_USE_ENVVAR) { |
|
6621
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
551 | if ((tmp = g_getenv("HTTP_PROXY")) != NULL || |
|
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
552 | (tmp = g_getenv("http_proxy")) != NULL || |
|
34219
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
553 | (tmp = g_getenv("HTTPPROXY")) != NULL) |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
554 | { |
|
39990
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
555 | SoupURI *url; |
|
6621
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
556 | |
| 9129 | 557 | /* http_proxy-format: |
| 9227 | 558 | * export http_proxy="http://user:passwd@your.proxy.server:port/" |
|
7652
d60ba2565661
[gaim-migrate @ 8296]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
7475
diff
changeset
|
559 | */ |
|
39990
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
560 | url = soup_uri_new(tmp); |
|
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
561 | if (!SOUP_URI_VALID_FOR_HTTP(url)) { |
|
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
562 | purple_debug_warning("proxy", "Couldn't parse URL: %s", tmp); |
|
34219
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
563 | return gpi; |
|
7652
d60ba2565661
[gaim-migrate @ 8296]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
7475
diff
changeset
|
564 | } |
|
34219
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
565 | |
|
39990
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
566 | purple_proxy_info_set_host(gpi, url->host); |
|
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
567 | purple_proxy_info_set_username(gpi, url->user); |
|
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
568 | purple_proxy_info_set_password(gpi, url->password); |
|
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
569 | purple_proxy_info_set_port(gpi, url->port); |
|
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
570 | |
|
7fb53d5427a8
Use SoupURI to parse proxy environment variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
571 | soup_uri_free(url); |
|
34219
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
572 | |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
573 | /* XXX: Do we want to skip this step if user/password/port were part of url? */ |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
574 | if ((tmp = g_getenv("HTTP_PROXY_USER")) != NULL || |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
575 | (tmp = g_getenv("http_proxy_user")) != NULL || |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
576 | (tmp = g_getenv("HTTPPROXYUSER")) != NULL) |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
577 | purple_proxy_info_set_username(gpi, tmp); |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
578 | |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
579 | if ((tmp = g_getenv("HTTP_PROXY_PASS")) != NULL || |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
580 | (tmp = g_getenv("http_proxy_pass")) != NULL || |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
581 | (tmp = g_getenv("HTTPPROXYPASS")) != NULL) |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
582 | purple_proxy_info_set_password(gpi, tmp); |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
583 | |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
584 | if ((tmp = g_getenv("HTTP_PROXY_PORT")) != NULL || |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
585 | (tmp = g_getenv("http_proxy_port")) != NULL || |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
586 | (tmp = g_getenv("HTTPPROXYPORT")) != NULL) |
|
eee308def583
HTTP: get rid of purple_url_parse
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34218
diff
changeset
|
587 | purple_proxy_info_set_port(gpi, atoi(tmp)); |
|
10534
c28eef1b882a
[gaim-migrate @ 11866]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10320
diff
changeset
|
588 | } else { |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
589 | #ifdef _WIN32 |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
590 | PurpleProxyInfo *wgpi; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
591 | if ((wgpi = purple_win32_proxy_get_info()) != NULL) |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
592 | return wgpi; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
24156
diff
changeset
|
593 | #endif |
|
10534
c28eef1b882a
[gaim-migrate @ 11866]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10320
diff
changeset
|
594 | /* no proxy environment variable found, don't use a proxy */ |
| 15884 | 595 | purple_debug_info("proxy", "No environment settings found, not using a proxy\n"); |
|
15032
65a111aba7a8
[gaim-migrate @ 17749]
Daniel Atallah <datallah@pidgin.im>
parents:
15015
diff
changeset
|
596 | gpi = tmp_none_proxy_info; |
|
6621
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
597 | } |
|
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
598 | |
|
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
599 | } |
|
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6320
diff
changeset
|
600 | |
| 13515 | 601 | return gpi; |
| 602 | } | |
| 603 | ||
|
37532
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
604 | GProxyResolver * |
|
37965
b67fb3fb5f85
proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37964
diff
changeset
|
605 | purple_proxy_get_proxy_resolver(PurpleAccount *account, GError **error) |
|
37532
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
606 | { |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
607 | PurpleProxyInfo *info = purple_proxy_get_setup(account); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
608 | const gchar *protocol; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
609 | const gchar *username; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
610 | const gchar *password; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
611 | gchar *auth; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
612 | gchar *proxy; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
613 | GProxyResolver *resolver; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
614 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
615 | if (purple_proxy_info_get_proxy_type(info) == PURPLE_PROXY_NONE) { |
|
37942
33f8691a69df
proxy: don't use default resolver if direct connection is wanted
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37939
diff
changeset
|
616 | /* Return an empty simple resolver, which will resolve on direct |
|
33f8691a69df
proxy: don't use default resolver if direct connection is wanted
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37939
diff
changeset
|
617 | * connection. */ |
|
33f8691a69df
proxy: don't use default resolver if direct connection is wanted
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37939
diff
changeset
|
618 | return g_simple_proxy_resolver_new(NULL, NULL); |
|
37532
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
619 | } |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
620 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
621 | switch (purple_proxy_info_get_proxy_type(info)) |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
622 | { |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
623 | /* PURPLE_PROXY_NONE already handled above */ |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
624 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
625 | case PURPLE_PROXY_USE_ENVVAR: |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
626 | /* Intentional passthrough */ |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
627 | case PURPLE_PROXY_HTTP: |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
628 | protocol = "http"; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
629 | break; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
630 | case PURPLE_PROXY_SOCKS4: |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
631 | protocol = "socks4"; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
632 | break; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
633 | case PURPLE_PROXY_SOCKS5: |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
634 | /* Intentional passthrough */ |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
635 | case PURPLE_PROXY_TOR: |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
636 | protocol = "socks5"; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
637 | break; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
638 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
639 | default: |
|
37965
b67fb3fb5f85
proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37964
diff
changeset
|
640 | g_set_error(error, PURPLE_CONNECTION_ERROR, |
|
b67fb3fb5f85
proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37964
diff
changeset
|
641 | PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, |
|
b67fb3fb5f85
proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37964
diff
changeset
|
642 | _("Invalid Proxy type (%d) specified"), |
|
37532
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
643 | purple_proxy_info_get_proxy_type(info)); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
644 | return NULL; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
645 | } |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
646 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
647 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
648 | if (purple_proxy_info_get_host(info) == NULL || |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
649 | purple_proxy_info_get_port(info) <= 0) { |
|
37965
b67fb3fb5f85
proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37964
diff
changeset
|
650 | g_set_error_literal(error, PURPLE_CONNECTION_ERROR, |
|
b67fb3fb5f85
proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37964
diff
changeset
|
651 | PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, |
|
37532
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
652 | _("Either the host name or port number " |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
653 | "specified for your given proxy type is " |
|
37965
b67fb3fb5f85
proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37964
diff
changeset
|
654 | "invalid.")); |
|
37532
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
655 | return NULL; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
656 | } |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
657 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
658 | /* Everything checks out. Create and return the GProxyResolver */ |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
659 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
660 | username = purple_proxy_info_get_username(info); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
661 | password = purple_proxy_info_get_password(info); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
662 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
663 | /* Username and password are optional */ |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
664 | if (username != NULL && password != NULL) { |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
665 | auth = g_strdup_printf("%s:%s@", username, password); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
666 | } else if (username != NULL) { |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
667 | auth = g_strdup_printf("%s@", username); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
668 | } else { |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
669 | auth = NULL; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
670 | } |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
671 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
672 | proxy = g_strdup_printf("%s://%s%s:%i", protocol, |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
673 | auth != NULL ? auth : "", |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
674 | purple_proxy_info_get_host(info), |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
675 | purple_proxy_info_get_port(info)); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
676 | g_free(auth); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
677 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
678 | resolver = g_simple_proxy_resolver_new(proxy, NULL); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
679 | g_free(proxy); |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
680 | |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
681 | return resolver; |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
682 | } |
|
5aaf2d93e7e3
Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents:
37518
diff
changeset
|
683 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
684 | static void |
| 15884 | 685 | proxy_pref_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12811
diff
changeset
|
686 | gconstpointer value, gpointer data) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
687 | { |
| 15884 | 688 | PurpleProxyInfo *info = purple_global_proxy_get_info(); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
689 | |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
690 | if (purple_strequal(name, "/purple/proxy/type")) { |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5970
diff
changeset
|
691 | int proxytype; |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12811
diff
changeset
|
692 | const char *type = value; |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5970
diff
changeset
|
693 | |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
694 | if (purple_strequal(type, "none")) |
| 15884 | 695 | proxytype = PURPLE_PROXY_NONE; |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
696 | else if (purple_strequal(type, "http")) |
| 15884 | 697 | proxytype = PURPLE_PROXY_HTTP; |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
698 | else if (purple_strequal(type, "socks4")) |
| 15884 | 699 | proxytype = PURPLE_PROXY_SOCKS4; |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
700 | else if (purple_strequal(type, "socks5")) |
| 15884 | 701 | proxytype = PURPLE_PROXY_SOCKS5; |
|
31677
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
30626
diff
changeset
|
702 | else if (purple_strequal(type, "tor")) |
|
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
30626
diff
changeset
|
703 | proxytype = PURPLE_PROXY_TOR; |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
704 | else if (purple_strequal(type, "envvar")) |
| 15884 | 705 | proxytype = PURPLE_PROXY_USE_ENVVAR; |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5970
diff
changeset
|
706 | else |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5970
diff
changeset
|
707 | proxytype = -1; |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5970
diff
changeset
|
708 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
709 | purple_proxy_info_set_proxy_type(info, proxytype); |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
710 | } else if (purple_strequal(name, "/purple/proxy/host")) |
| 15884 | 711 | purple_proxy_info_set_host(info, value); |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
712 | else if (purple_strequal(name, "/purple/proxy/port")) |
| 15884 | 713 | purple_proxy_info_set_port(info, GPOINTER_TO_INT(value)); |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
714 | else if (purple_strequal(name, "/purple/proxy/username")) |
| 15884 | 715 | purple_proxy_info_set_username(info, value); |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24866
diff
changeset
|
716 | else if (purple_strequal(name, "/purple/proxy/password")) |
| 15884 | 717 | purple_proxy_info_set_password(info, value); |
|
1087
bc9c6b635358
[gaim-migrate @ 1097]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1057
diff
changeset
|
718 | } |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
719 | |
|
14151
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
720 | void * |
| 15884 | 721 | purple_proxy_get_handle() |
|
14151
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
722 | { |
|
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
723 | static int handle; |
|
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
724 | |
|
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
725 | return &handle; |
|
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
726 | } |
|
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
727 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
728 | void |
| 15884 | 729 | purple_proxy_init(void) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
730 | { |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9863
diff
changeset
|
731 | void *handle; |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9863
diff
changeset
|
732 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
733 | /* Initialize a default proxy info struct. */ |
| 15884 | 734 | global_proxy_info = purple_proxy_info_new(); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
735 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
736 | /* Proxy */ |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
737 | purple_prefs_add_none("/purple/proxy"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
738 | purple_prefs_add_string("/purple/proxy/type", "none"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
739 | purple_prefs_add_string("/purple/proxy/host", ""); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
740 | purple_prefs_add_int("/purple/proxy/port", 0); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
741 | purple_prefs_add_string("/purple/proxy/username", ""); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
742 | purple_prefs_add_string("/purple/proxy/password", ""); |
|
25624
62b56bc39896
Implement support for resolving DNS via the SOCKS4 proxy in use.
Daniel Atallah <datallah@pidgin.im>
parents:
25623
diff
changeset
|
743 | purple_prefs_add_bool("/purple/proxy/socks4_remotedns", FALSE); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
744 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
745 | /* Setup callbacks for the preferences. */ |
| 15884 | 746 | handle = purple_proxy_get_handle(); |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
747 | purple_prefs_connect_callback(handle, "/purple/proxy/type", proxy_pref_cb, |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13085
diff
changeset
|
748 | NULL); |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
749 | purple_prefs_connect_callback(handle, "/purple/proxy/host", proxy_pref_cb, |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13085
diff
changeset
|
750 | NULL); |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
751 | purple_prefs_connect_callback(handle, "/purple/proxy/port", proxy_pref_cb, |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13085
diff
changeset
|
752 | NULL); |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
753 | purple_prefs_connect_callback(handle, "/purple/proxy/username", |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13085
diff
changeset
|
754 | proxy_pref_cb, NULL); |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16037
diff
changeset
|
755 | purple_prefs_connect_callback(handle, "/purple/proxy/password", |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13085
diff
changeset
|
756 | proxy_pref_cb, NULL); |
|
20053
68ce40196f8a
grab revision 6be36979d022284283217c2a32f2b812740cbbf3
Luke Schierer <lschiere@pidgin.im>
parents:
19985
diff
changeset
|
757 | |
|
68ce40196f8a
grab revision 6be36979d022284283217c2a32f2b812740cbbf3
Luke Schierer <lschiere@pidgin.im>
parents:
19985
diff
changeset
|
758 | /* Load the initial proxy settings */ |
|
20055
ca7144d5605f
grab revision 240d37f3b465527200f862ff3c0da77618ae32ae
Luke Schierer <lschiere@pidgin.im>
parents:
20053
diff
changeset
|
759 | purple_prefs_trigger_callback("/purple/proxy/type"); |
|
ca7144d5605f
grab revision 240d37f3b465527200f862ff3c0da77618ae32ae
Luke Schierer <lschiere@pidgin.im>
parents:
20053
diff
changeset
|
760 | purple_prefs_trigger_callback("/purple/proxy/host"); |
|
ca7144d5605f
grab revision 240d37f3b465527200f862ff3c0da77618ae32ae
Luke Schierer <lschiere@pidgin.im>
parents:
20053
diff
changeset
|
761 | purple_prefs_trigger_callback("/purple/proxy/port"); |
|
ca7144d5605f
grab revision 240d37f3b465527200f862ff3c0da77618ae32ae
Luke Schierer <lschiere@pidgin.im>
parents:
20053
diff
changeset
|
762 | purple_prefs_trigger_callback("/purple/proxy/username"); |
|
ca7144d5605f
grab revision 240d37f3b465527200f862ff3c0da77618ae32ae
Luke Schierer <lschiere@pidgin.im>
parents:
20053
diff
changeset
|
763 | purple_prefs_trigger_callback("/purple/proxy/password"); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
764 | } |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9863
diff
changeset
|
765 | |
|
14151
34427f138b1f
[gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
766 | void |
| 15884 | 767 | purple_proxy_uninit(void) |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9863
diff
changeset
|
768 | { |
|
28177
e62fe687ca6c
Clean up various file-scoped globals at uninit.
Paul Aurich <darkrain42@pidgin.im>
parents:
27943
diff
changeset
|
769 | purple_prefs_disconnect_by_handle(purple_proxy_get_handle()); |
|
e62fe687ca6c
Clean up various file-scoped globals at uninit.
Paul Aurich <darkrain42@pidgin.im>
parents:
27943
diff
changeset
|
770 | |
|
e62fe687ca6c
Clean up various file-scoped globals at uninit.
Paul Aurich <darkrain42@pidgin.im>
parents:
27943
diff
changeset
|
771 | purple_proxy_info_destroy(global_proxy_info); |
|
e62fe687ca6c
Clean up various file-scoped globals at uninit.
Paul Aurich <darkrain42@pidgin.im>
parents:
27943
diff
changeset
|
772 | global_proxy_info = NULL; |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9863
diff
changeset
|
773 | } |