comparison src/sslconn.c @ 6764:6d0d4e9149b9

[gaim-migrate @ 7296] well, jabber.org is being a pain in the moment, as is my server. but this seems to work, so here it is. Jabber SSL support. Make sure you set the port to 5223 and check the "Use SSL" checkbox in the account editor. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 06 Sep 2003 16:04:41 +0000
parents 818ce550d2ce
children aa619031193b
comparison
equal deleted inserted replaced
6763:362e60e7c265 6764:6d0d4e9149b9
91 91
92 gsc = g_new0(GaimSslConnection, 1); 92 gsc = g_new0(GaimSslConnection, 1);
93 93
94 gsc->host = g_strdup(host); 94 gsc->host = g_strdup(host);
95 gsc->port = port; 95 gsc->port = port;
96 gsc->user_data = data; 96 gsc->connect_cb_data = data;
97 gsc->input_func = func; 97 gsc->connect_cb = func;
98 98
99 i = gaim_proxy_connect(account, host, port, ops->connect_cb, gsc); 99 i = gaim_proxy_connect(account, host, port, ops->connect_cb, gsc);
100 100
101 if (i < 0) 101 if (i < 0)
102 { 102 {
105 105
106 return NULL; 106 return NULL;
107 } 107 }
108 108
109 return (GaimSslConnection *)gsc; 109 return (GaimSslConnection *)gsc;
110 }
111
112 static void
113 recv_cb(gpointer data, gint source, GaimInputCondition cond)
114 {
115 GaimSslConnection *gsc = data;
116
117 gsc->recv_cb(gsc->recv_cb_data, gsc, cond);
118 }
119
120 void
121 gaim_ssl_input_add(GaimSslConnection *gsc, GaimSslInputFunction func, void *data)
122 {
123 GaimSslOps *ops;
124
125 g_return_if_fail(func != NULL);
126 g_return_if_fail(gaim_ssl_is_supported());
127
128 ops = gaim_ssl_get_ops();
129
130 gsc->recv_cb_data = data;
131 gsc->recv_cb = func;
132 gsc->inpa = gaim_input_add(gsc->fd, GAIM_INPUT_READ, recv_cb, gsc);
110 } 133 }
111 134
112 GaimSslConnection * 135 GaimSslConnection *
113 gaim_ssl_connect_fd(GaimAccount *account, int fd, 136 gaim_ssl_connect_fd(GaimAccount *account, int fd,
114 GaimSslInputFunction func, void *data) 137 GaimSslInputFunction func, void *data)
131 return NULL; 154 return NULL;
132 } 155 }
133 156
134 gsc = g_new0(GaimSslConnection, 1); 157 gsc = g_new0(GaimSslConnection, 1);
135 158
136 gsc->user_data = data; 159 gsc->connect_cb_data = data;
137 gsc->input_func = func; 160 gsc->connect_cb = func;
138 161
139 ops->connect_cb(gsc, fd, GAIM_INPUT_READ); 162 ops->connect_cb(gsc, fd, GAIM_INPUT_READ);
140 163
141 return (GaimSslConnection *)gsc; 164 return (GaimSslConnection *)gsc;
142 } 165 }