Mercurial > pidgin
comparison src/sslconn.c @ 14166:fcae2cfe26eb
[gaim-migrate @ 16816]
I will apologize in advance for this ugliness - it is necessary because we have a "connect" macro to cause the wgaim_connect() wrapper function to be used.
committer: Tailor Script <tailor@pidgin.im>
| author | Daniel Atallah <daniel.atallah@gmail.com> |
|---|---|
| date | Thu, 17 Aug 2006 15:19:12 +0000 |
| parents | c8ebbc0110f4 |
| children | 8160857cd958 |
comparison
equal
deleted
inserted
replaced
| 14165:b04e36dae7af | 14166:fcae2cfe26eb |
|---|---|
| 69 static void | 69 static void |
| 70 gaim_ssl_connect_cb(gpointer data, gint source, const gchar *error_message) | 70 gaim_ssl_connect_cb(gpointer data, gint source, const gchar *error_message) |
| 71 { | 71 { |
| 72 GaimSslConnection *gsc; | 72 GaimSslConnection *gsc; |
| 73 GaimSslOps *ops; | 73 GaimSslOps *ops; |
| 74 void (*connect_func)(GaimSslConnection *gsc); | |
| 74 | 75 |
| 75 gsc = data; | 76 gsc = data; |
| 76 gsc->connect_info = NULL; | 77 gsc->connect_info = NULL; |
| 77 | 78 |
| 78 if (source < 0) | 79 if (source < 0) |
| 85 } | 86 } |
| 86 | 87 |
| 87 gsc->fd = source; | 88 gsc->fd = source; |
| 88 | 89 |
| 89 ops = gaim_ssl_get_ops(); | 90 ops = gaim_ssl_get_ops(); |
| 90 ops->connect(gsc); | 91 connect_func = (ops->connect); |
| 92 connect_func(gsc); | |
| 91 } | 93 } |
| 92 | 94 |
| 93 GaimSslConnection * | 95 GaimSslConnection * |
| 94 gaim_ssl_connect(GaimAccount *account, const char *host, int port, | 96 gaim_ssl_connect(GaimAccount *account, const char *host, int port, |
| 95 GaimSslInputFunction func, GaimSslErrorFunction error_func, | 97 GaimSslInputFunction func, GaimSslErrorFunction error_func, |
| 156 GaimSslInputFunction func, | 158 GaimSslInputFunction func, |
| 157 GaimSslErrorFunction error_func, void *data) | 159 GaimSslErrorFunction error_func, void *data) |
| 158 { | 160 { |
| 159 GaimSslConnection *gsc; | 161 GaimSslConnection *gsc; |
| 160 GaimSslOps *ops; | 162 GaimSslOps *ops; |
| 163 void (*connect_func)(GaimSslConnection *gsc); | |
| 161 | 164 |
| 162 g_return_val_if_fail(fd != -1, NULL); | 165 g_return_val_if_fail(fd != -1, NULL); |
| 163 g_return_val_if_fail(func != NULL, NULL); | 166 g_return_val_if_fail(func != NULL, NULL); |
| 164 g_return_val_if_fail(gaim_ssl_is_supported(), NULL); | 167 g_return_val_if_fail(gaim_ssl_is_supported(), NULL); |
| 165 | 168 |
| 175 gsc->connect_cb = func; | 178 gsc->connect_cb = func; |
| 176 gsc->error_cb = error_func; | 179 gsc->error_cb = error_func; |
| 177 gsc->fd = fd; | 180 gsc->fd = fd; |
| 178 | 181 |
| 179 ops = gaim_ssl_get_ops(); | 182 ops = gaim_ssl_get_ops(); |
| 180 ops->connect(gsc); | 183 connect_func = ops->connect; |
| 184 connect_func(gsc); | |
| 181 | 185 |
| 182 return (GaimSslConnection *)gsc; | 186 return (GaimSslConnection *)gsc; |
| 183 } | 187 } |
| 184 | 188 |
| 185 void | 189 void |
