libpurple/protocols/gg/tcpsocket.c

Tue, 21 Mar 2023 01:59:19 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 21 Mar 2023 01:59:19 -0500
changeset 42175
4185b4043214
parent 42085
a76f1668564c
permissions
-rw-r--r--

Use g_clear_handle_id everywhere

Testing Done:
Compiled and ran tests in valgrind.

Reviewed at https://reviews.imfreedom.org/r/2374/

35358
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
1 /* purple
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
2 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
5 * source distribution.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
6 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
7 * Component written by Tomek Wasilczyk (http://www.wasilczyk.pl).
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
8 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
9 * This file is dual-licensed under the GPL2+ and the X11 (MIT) licences.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
10 * As a recipient of this file you may choose, which license to receive the
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
11 * code under. As a contributor, you have to ensure the new code is
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
12 * compatible with both.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
13 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
14 * This program is free software; you can redistribute it and/or modify
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
15 * it under the terms of the GNU General Public License as published by
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
16 * the Free Software Foundation; either version 2 of the License, or
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
17 * (at your option) any later version.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
18 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
19 * This program is distributed in the hope that it will be useful,
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
22 * GNU General Public License for more details.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
23 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
24 * You should have received a copy of the GNU General Public License
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
25 * along with this program; if not, write to the Free Software
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34473
diff changeset
27 */
40523
9bcf96663cb9 Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
28
9bcf96663cb9 Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
29 #include <errno.h>
9bcf96663cb9 Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
30
9bcf96663cb9 Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
31 #include <purple.h>
9bcf96663cb9 Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
32
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
33 #include "tcpsocket.h"
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
34
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
35 #include "gg.h"
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
36
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40358
diff changeset
37
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
38 typedef struct {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
39 GSocketConnection *conn;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
40 GCancellable *cancellable;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
41 PurpleConnection *gc;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
42 gpointer priv_gg;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
43 } GGPTcpSocketData;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
44
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
45 static void
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
46 ggp_tcp_socket_data_free(GGPTcpSocketData *data)
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
47 {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
48 g_return_if_fail(data != NULL);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
49
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
50 if (data->cancellable != NULL) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
51 g_cancellable_cancel(data->cancellable);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
52 g_clear_object(&data->cancellable);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
53 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
54
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
55 if (data->conn != NULL) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
56 purple_gio_graceful_close(G_IO_STREAM(data->conn), NULL, NULL);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
57 g_clear_object(&data->conn);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
58 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
59
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
60 g_free(data);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
61 }
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
62
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
63 static void
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
64 ggp_tcpsocket_connected(GObject *source, GAsyncResult *res, gpointer user_data)
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
65 {
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
66 GGPTcpSocketData *data = user_data;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
67 GSocketConnection *conn;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
68 GSocket *socket;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
69 int fd = -1;
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
70 GGPInfo *info;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
71 GError *error = NULL;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
72
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
73 conn = g_socket_client_connect_to_host_finish(G_SOCKET_CLIENT(source),
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
74 res, &error);
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
75
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
76 if (conn == NULL) {
38142
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
77 if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
78 /* The connection was already closed, return now */
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
79 g_clear_error(&error);
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
80 return;
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
81 }
36068
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
82
38142
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
83 purple_debug_error("gg", "socket failed to connect: %s",
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
84 error->message);
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
85 g_clear_error(&error);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
86 } else {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
87 data->conn = conn;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
88
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
89 socket = g_socket_connection_get_socket(data->conn);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
90
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
91 if (socket != NULL) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
92 fd = g_socket_get_fd(socket);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
93 }
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
94 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
95
38142
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
96 /* XXX: For some reason if you try to connect and then immediately
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
97 * disconnect, this gets into a state where ggp_tcpsocket_close()
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
98 * isn't called. The cancellable is therefore not cancelled, and
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
99 * the connection is never closed. Guard against that state here.
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
100 */
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
101 if (data->gc == NULL ||
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
102 !g_list_find(purple_connections_get_all(), data->gc)) {
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
103 purple_debug_error("gg",
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
104 "disconnected without closing connection: %p",
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
105 data);
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
106 ggp_tcp_socket_data_free(data);
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
107 return;
1dff6e343f9f gg: Protect against issues when closing while connecting
Mike Ruprecht <cmaiku@gmail.com>
parents: 38139
diff changeset
108 }
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
109
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
110 if (!gg_socket_manager_connected(data, data->priv_gg, fd)) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
111 purple_debug_error("gg", "socket not handled");
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
112 ggp_tcp_socket_data_free(data);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
113 return;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
114 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
115
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
116 info = purple_connection_get_protocol_data(data->gc);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
117
42175
4185b4043214 Use g_clear_handle_id everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42085
diff changeset
118 g_clear_handle_id(&info->inpa, g_source_remove);
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
119
34442
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
120 if (info->session->fd < 0)
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
121 return;
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
122
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
123 /* XXX: This works, but not recommended to use GSocket FDs directly */
34442
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
124 info->inpa = purple_input_add(info->session->fd,
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
125 ggp_tcpsocket_inputcond_gg_to_purple(info->session->check),
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
126 ggp_async_login_handler, data->gc);
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
127 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
128
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
129 static void*
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
130 ggp_tcpsocket_connect(void *_gc, const char *host, int port, int is_tls,
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
131 int is_async, void *priv)
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
132 {
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
133 PurpleConnection *gc = _gc;
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
134 GGPTcpSocketData *data;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
135 GSocketClient *client;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
136 GError *error = NULL;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
137
36068
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
138 PURPLE_ASSERT_CONNECTION_IS_VALID(gc);
36067
df9f5de00ea2 PurpleSocket: fix a crash
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
139
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
140 g_return_val_if_fail(host != NULL, NULL);
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
141 g_return_val_if_fail(is_async, NULL);
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
142
34434
e2b8c80078c0 Fix typo
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34433
diff changeset
143 purple_debug_misc("gg", "ggp_tcpsocket_connect(%p, %s:%d, %s, %p)",
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
144 gc, host, port, is_tls ? "tls" : "tcp", priv);
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
145
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
146 client = purple_gio_socket_client_new(
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
147 purple_connection_get_account(gc), &error);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
148
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
149 if (client == NULL) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
150 purple_debug_error("gg", "unable to connect: %s",
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
151 error->message);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
152 g_clear_error(&error);
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
153 return NULL;
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
154 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
155
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
156 g_socket_client_set_tls(client, is_tls);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
157
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
158 data = g_new0(GGPTcpSocketData, 1);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
159 data->cancellable = g_cancellable_new();
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
160 data->gc = gc;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
161 data->priv_gg = priv;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
162
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
163 g_socket_client_connect_to_host_async(client, host, port,
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
164 data->cancellable, ggp_tcpsocket_connected, data);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
165 g_object_unref(client);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
166
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
167 return data;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
168 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
169
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
170 static void
42085
a76f1668564c Make the gadu gadu protocol plugin clean for warning level 2
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
171 ggp_tcpsocket_close(G_GNUC_UNUSED void *_gc, void *_data) {
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
172 GGPTcpSocketData *data = _data;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
173
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
174 ggp_tcp_socket_data_free(data);
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
175 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
176
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
177 static ssize_t
42085
a76f1668564c Make the gadu gadu protocol plugin clean for warning level 2
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
178 ggp_tcpsocket_read(G_GNUC_UNUSED void *_gc, void *_data,
a76f1668564c Make the gadu gadu protocol plugin clean for warning level 2
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
179 unsigned char *buffer, size_t bufsize)
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
180 {
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
181 GGPTcpSocketData *data = _data;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
182 GPollableInputStream *input;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
183 gssize ret;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
184 GError *error = NULL;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
185
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
186 if (data->conn == NULL) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
187 return -1;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
188 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
189
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
190 input = G_POLLABLE_INPUT_STREAM(
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
191 g_io_stream_get_input_stream(G_IO_STREAM(data->conn)));
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
192 ret = g_pollable_input_stream_read_nonblocking(input,
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
193 buffer, bufsize, NULL, &error);
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
194
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
195 if (ret < 0) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
196 if (g_error_matches(error,
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
197 G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
198 errno = EAGAIN;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
199 } else {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
200 purple_debug_error("gg", "socket read error: %s",
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
201 error->message);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
202 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
203
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
204 g_clear_error(&error);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
205 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
206
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
207 return ret;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
208 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
209
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
210 static ssize_t
42085
a76f1668564c Make the gadu gadu protocol plugin clean for warning level 2
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
211 ggp_tcpsocket_write(G_GNUC_UNUSED void *_gc, void *_data,
a76f1668564c Make the gadu gadu protocol plugin clean for warning level 2
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
212 const unsigned char *data_buf, size_t len)
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
213 {
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
214 GGPTcpSocketData *data = _data;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
215 GPollableOutputStream *output;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
216 gssize ret;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
217 GError *error = NULL;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
218
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
219 if (data->conn == NULL) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
220 return -1;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
221 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
222
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
223 output = G_POLLABLE_OUTPUT_STREAM(
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
224 g_io_stream_get_output_stream(G_IO_STREAM(data->conn)));
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
225 ret = g_pollable_output_stream_write_nonblocking(output,
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
226 data_buf, len, NULL, &error);
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
227
38139
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
228 if (ret < 0) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
229 if (g_error_matches(error,
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
230 G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
231 errno = EAGAIN;
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
232 } else {
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
233 purple_debug_error("gg", "socket write error: %s",
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
234 error->message);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
235 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
236
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
237 g_clear_error(&error);
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
238 }
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
239
42143502b9d0 gg: Port to Gio
Mike Ruprecht <cmaiku@gmail.com>
parents: 37417
diff changeset
240 return ret;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
241 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
242
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
243 void
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
244 ggp_tcpsocket_setup(PurpleConnection *gc, struct gg_login_params *glp)
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
245 {
37417
b29ee022017f Require SSL/TLS support. ok'd by elb@
Michael McConville <mmcco@mykolab.com>
parents: 36124
diff changeset
246 glp->socket_manager_type = GG_SOCKET_MANAGER_TYPE_TLS;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
247 glp->socket_manager.cb_data = gc;
34473
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34442
diff changeset
248 glp->socket_manager.connect_cb = ggp_tcpsocket_connect;
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34442
diff changeset
249 glp->socket_manager.close_cb = ggp_tcpsocket_close;
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34442
diff changeset
250 glp->socket_manager.read_cb = ggp_tcpsocket_read;
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34442
diff changeset
251 glp->socket_manager.write_cb = ggp_tcpsocket_write;
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
252 }
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
253
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
254 PurpleInputCondition
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
255 ggp_tcpsocket_inputcond_gg_to_purple(enum gg_check_t check)
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
256 {
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
257 PurpleInputCondition cond = 0;
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
258
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
259 if (check & GG_CHECK_READ)
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
260 cond |= PURPLE_INPUT_READ;
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
261 if (check & GG_CHECK_WRITE)
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
262 cond |= PURPLE_INPUT_WRITE;
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
263
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
264 return cond;
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff changeset
265 }

mercurial