/pidgin/main: 4534c27446e8: Gadu-Gadu: better fit for new API
Tomasz Wasilczyk
twasilczyk at pidgin.im
Tue Sep 17 05:19:35 EDT 2013
Changeset: 4534c27446e87f2b27511bcf8b30717940dc8a8c
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2013-09-17 11:19 +0200
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/4534c27446e8
Description:
Gadu-Gadu: better fit for new API
diffstat:
libpurple/protocols/gg/gg.c | 8 ++++++++
libpurple/protocols/gg/tcpsocket.c | 8 +++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diffs (47 lines):
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -414,6 +414,9 @@ void ggp_async_login_handler(gpointer _g
info->session->check, info->session->state);
switch (info->session->state) {
+ case GG_STATE_ERROR:
+ purple_debug_info("gg", "GG_STATE_ERROR\n");
+ break;
case GG_STATE_RESOLVING:
purple_debug_info("gg", "GG_STATE_RESOLVING\n");
break;
@@ -550,6 +553,11 @@ void ggp_async_login_handler(gpointer _g
_("Error connecting to master "
"server"));
break;
+ case GG_FAILURE_INTERNAL:
+ purple_connection_error(gc,
+ PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ _("Internal error"));
+ break;
default:
purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
diff --git a/libpurple/protocols/gg/tcpsocket.c b/libpurple/protocols/gg/tcpsocket.c
--- a/libpurple/protocols/gg/tcpsocket.c
+++ b/libpurple/protocols/gg/tcpsocket.c
@@ -20,13 +20,15 @@ ggp_tcpsocket_connected(PurpleSocket *ps
if (!gg_socket_manager_connected(ps, priv_gg, fd)) {
purple_debug_error("gg", "socket not handled");
purple_socket_destroy(ps);
- return;
}
if (info->inpa > 0)
purple_input_remove(info->inpa);
- info->inpa = purple_input_add(fd, ggp_tcpsocket_inputcond_gg_to_purple(
- info->session->check), ggp_async_login_handler, gc);
+ if (info->session->fd < 0)
+ return;
+ info->inpa = purple_input_add(info->session->fd,
+ ggp_tcpsocket_inputcond_gg_to_purple(info->session->check),
+ ggp_async_login_handler, gc);
}
static void*
More information about the Commits
mailing list