/pidgin/main: 510425bd6583: HTTP: simplify socket code

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue Aug 27 13:10:04 EDT 2013


Changeset: 510425bd65832830901eb217e5033b50bee17ae0
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2013-08-27 19:09 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/510425bd6583

Description:

HTTP: simplify socket code

diffstat:

 libpurple/http.c |  30 ++----------------------------
 1 files changed, 2 insertions(+), 28 deletions(-)

diffs (60 lines):

diff --git a/libpurple/http.c b/libpurple/http.c
--- a/libpurple/http.c
+++ b/libpurple/http.c
@@ -531,10 +531,6 @@ purple_http_socket_connect_new(PurpleCon
 			host, port,
 			_purple_http_socket_connected_ssl,
 			_purple_http_socket_connected_ssl_error, hs);
-/* TODO
-		purple_ssl_set_compatibility_level(hs->ssl_connection,
-			PURPLE_SSL_COMPATIBILITY_SECURE);
-*/
 	} else {
 		hs->raw_connection = purple_proxy_connect(gc, account,
 			host, port,
@@ -577,34 +573,14 @@ purple_http_socket_write(PurpleHttpSocke
 		return write(hs->fd, buf, len);
 }
 
-static void _purple_http_socket_watch_recv_ssl(gpointer _hs,
-	PurpleSslConnection *ssl_connection, PurpleInputCondition cond)
-{
-	PurpleHttpSocket *hs = _hs;
-
-	g_return_if_fail(hs != NULL);
-
-	hs->watch_cb(hs->cb_data, hs->fd, cond);
-}
-
 static void
 purple_http_socket_watch(PurpleHttpSocket *hs, PurpleInputCondition cond,
 	PurpleInputFunction func, gpointer user_data)
 {
 	g_return_if_fail(hs != NULL);
 
-	if (hs->inpa > 0)
-		purple_input_remove(hs->inpa);
-	hs->inpa = 0;
-
-	if (cond == PURPLE_INPUT_READ && hs->is_ssl) {
-		hs->watch_cb = func;
-		hs->cb_data = user_data;
-		purple_ssl_input_add(hs->ssl_connection,
-			_purple_http_socket_watch_recv_ssl, hs);
-	}
-	else
-		hs->inpa = purple_input_add(hs->fd, cond, func, user_data);
+	purple_http_socket_dontwatch(hs);
+	hs->inpa = purple_input_add(hs->fd, cond, func, user_data);
 }
 
 static void
@@ -615,8 +591,6 @@ purple_http_socket_dontwatch(PurpleHttpS
 	if (hs->inpa > 0)
 		purple_input_remove(hs->inpa);
 	hs->inpa = 0;
-	if (hs->ssl_connection)
-		purple_ssl_input_remove(hs->ssl_connection);
 }
 
 static void



More information about the Commits mailing list