aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-10-26 05:18:51 -0300
committerdequis <dx@dxzone.com.ar>2015-10-26 05:28:10 -0300
commit0db66186f49438ae9c2f73ca85b915e999896309 (patch)
treee79f3ef3e17866ed19415f877b8526b920b7c85b
parent4e365cec5275e3dec782af3ec0bc9a651cc2b831 (diff)
Use proxy_disconnect() in http, ssl, jabber, oscar
Twitter and MSN are all HTTP/SSL, so they don't need it either. The out of tree facebook and steam plugins are also covered by the HTTP/SSL changes. Yahoo is written in a weird way and doesn't seem to need it (it seems it doesn't immediately stop connections when you tell it to logout)
-rw-r--r--lib/http_client.c2
-rw-r--r--lib/ssl_gnutls.c2
-rw-r--r--lib/ssl_nss.c6
-rw-r--r--lib/ssl_openssl.c4
-rw-r--r--protocols/jabber/jabber.c2
-rw-r--r--protocols/oscar/conn.c2
6 files changed, 10 insertions, 8 deletions
diff --git a/lib/http_client.c b/lib/http_client.c
index 9110b70a..2369d018 100644
--- a/lib/http_client.c
+++ b/lib/http_client.c
@@ -699,7 +699,7 @@ void http_close(struct http_request *req)
if (req->ssl) {
ssl_disconnect(req->ssl);
} else {
- closesocket(req->fd);
+ proxy_disconnect(req->fd);
}
http_free(req);
diff --git a/lib/ssl_gnutls.c b/lib/ssl_gnutls.c
index 2d52db52..d7200951 100644
--- a/lib/ssl_gnutls.c
+++ b/lib/ssl_gnutls.c
@@ -454,7 +454,7 @@ void ssl_disconnect(void *conn_)
gnutls_bye(conn->session, GNUTLS_SHUT_WR);
}
- closesocket(conn->fd);
+ proxy_disconnect(conn->fd);
if (conn->session) {
gnutls_deinit(conn->session);
diff --git a/lib/ssl_nss.c b/lib/ssl_nss.c
index 09e50f3f..78121a4e 100644
--- a/lib/ssl_nss.c
+++ b/lib/ssl_nss.c
@@ -225,8 +225,8 @@ ssl_connected_failure:
if (conn->prfd) {
PR_Close(conn->prfd);
- }
- if (source >= 0) {
+ } else if (source >= 0) {
+ /* proxy_disconnect() would be redundant here */
closesocket(source);
}
g_free(conn->hostname);
@@ -304,6 +304,8 @@ void ssl_disconnect(void *conn_)
if (conn->prfd) {
PR_Close(conn->prfd);
+ } else if (conn->fd) {
+ proxy_disconnect(conn->fd);
}
g_free(conn->hostname);
diff --git a/lib/ssl_openssl.c b/lib/ssl_openssl.c
index c286d509..38ce0598 100644
--- a/lib/ssl_openssl.c
+++ b/lib/ssl_openssl.c
@@ -130,7 +130,7 @@ static gboolean ssl_connected(gpointer data, gint source, b_input_condition cond
/* Right now we don't have any verification functionality for OpenSSL. */
conn->func(conn->data, 1, NULL, cond);
if (source >= 0) {
- closesocket(source);
+ proxy_disconnect(source);
}
ssl_conn_free(conn);
@@ -275,7 +275,7 @@ void ssl_disconnect(void *conn_)
SSL_shutdown(conn->ssl);
}
- closesocket(conn->fd);
+ proxy_disconnect(conn->fd);
ssl_conn_free(conn);
}
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index 74c870e7..0dbcfa4e 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -344,7 +344,7 @@ static void jabber_logout(struct im_connection *ic)
ssl_disconnect(jd->ssl);
}
if (jd->fd >= 0) {
- closesocket(jd->fd);
+ proxy_disconnect(jd->fd);
}
if (jd->tx_len) {
diff --git a/protocols/oscar/conn.c b/protocols/oscar/conn.c
index 568f4548..ce29abce 100644
--- a/protocols/oscar/conn.c
+++ b/protocols/oscar/conn.c
@@ -316,7 +316,7 @@ void aim_conn_close(aim_conn_t *deadconn)
{
if (deadconn->fd >= 3) {
- closesocket(deadconn->fd);
+ proxy_disconnect(deadconn->fd);
}
deadconn->fd = -1;
if (deadconn->handlerlist) {