From 35f6677c07770f0323872e4edddefb7b752e50bd Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 21 Oct 2006 22:48:44 +0200 Subject: Proper detections of errors from *_connect() and added a "Connecting" message in jabber_login(). --- protocols/jabber/io.c | 4 ---- protocols/jabber/jabber.c | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'protocols/jabber') diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index 665f5322..bc08a977 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -101,8 +101,6 @@ static gboolean jabber_write_queue( struct gaim_connection *gc ) else st = write( jd->fd, jd->txq, jd->tx_len ); -// if( st > 0 ) write( 1, jd->txq, st ); - if( st == jd->tx_len ) { /* We wrote everything, clear the buffer. */ @@ -156,8 +154,6 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition else st = read( jd->fd, buf, sizeof( buf ) ); -// if( st > 0 ) write( 1, buf, st ); - if( st > 0 ) { /* Parse. */ diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 3a2cb246..fd8b6128 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -158,6 +158,8 @@ static void jabber_login( account_t *acc ) else connect_to = jd->server; + set_login_progress( gc, "Connecting" ); + /* For non-SSL connections we can try to use the port # from the SRV reply, but let's not do that when using SSL, SSL usually runs on non-standard ports... */ @@ -170,8 +172,13 @@ static void jabber_login( account_t *acc ) { jd->fd = proxy_connect( connect_to, srv ? srv->port : set_getint( &acc->set, "port" ), jabber_connected_plain, gc ); } - g_free( srv ); + + if( jd->fd == -1 ) + { + hide_login_progress( gc, "Could not connect to server" ); + signoff( gc ); + } } static void jabber_close( struct gaim_connection *gc ) -- cgit v1.2.3