Mercurial > pidgin.yaz
diff src/sslconn.c @ 7274:448e39ace278
[gaim-migrate @ 7851]
Added a parameter to gaim_ssl_connect() to specify an optional error
callback. MSN takes advantage of it, but since I can't reproduce the errors
here, I'm not positive it works. It should though! Famous last words.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 15 Oct 2003 06:32:13 +0000 |
parents | 001d11a7e345 |
children | ef0684dfdf74 |
line wrap: on
line diff
--- a/src/sslconn.c Wed Oct 15 06:11:26 2003 +0000 +++ b/src/sslconn.c Wed Oct 15 06:32:13 2003 +0000 @@ -63,7 +63,8 @@ GaimSslConnection * gaim_ssl_connect(GaimAccount *account, const char *host, int port, - GaimSslInputFunction func, void *data) + GaimSslInputFunction func, GaimSslErrorFunction error_func, + void *data) { GaimSslConnection *gsc; GaimSslOps *ops; @@ -87,10 +88,11 @@ gsc = g_new0(GaimSslConnection, 1); - gsc->host = g_strdup(host); - gsc->port = port; - gsc->connect_cb_data = data; - gsc->connect_cb = func; + gsc->host = g_strdup(host); + gsc->port = port; + gsc->connect_cb_data = data; + gsc->connect_cb = func; + gsc->error_cb = error_func; i = gaim_proxy_connect(account, host, port, ops->connect_cb, gsc); @@ -114,7 +116,8 @@ } void -gaim_ssl_input_add(GaimSslConnection *gsc, GaimSslInputFunction func, void *data) +gaim_ssl_input_add(GaimSslConnection *gsc, GaimSslInputFunction func, + void *data) { GaimSslOps *ops; @@ -124,13 +127,15 @@ ops = gaim_ssl_get_ops(); gsc->recv_cb_data = data; - gsc->recv_cb = func; + gsc->recv_cb = func; + gsc->inpa = gaim_input_add(gsc->fd, GAIM_INPUT_READ, recv_cb, gsc); } GaimSslConnection * gaim_ssl_connect_fd(GaimAccount *account, int fd, - GaimSslInputFunction func, void *data) + GaimSslInputFunction func, + GaimSslErrorFunction error_func, void *data) { GaimSslConnection *gsc; GaimSslOps *ops; @@ -152,8 +157,9 @@ gsc = g_new0(GaimSslConnection, 1); - gsc->connect_cb_data = data; - gsc->connect_cb = func; + gsc->connect_cb_data = data; + gsc->connect_cb = func; + gsc->error_cb = error_func; ops->connect_cb(gsc, fd, GAIM_INPUT_READ);