diff options
Diffstat (limited to 'protocols/jabber/io.c')
| -rw-r--r-- | protocols/jabber/io.c | 27 | 
1 files changed, 14 insertions, 13 deletions
| diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index bf52fb4e..c64901f7 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -117,7 +117,7 @@ static gboolean jabber_write_queue( struct im_connection *ic )  		jd->fd = -1;  		imc_error( ic, "Short write() to server" ); -		imc_logout( ic ); +		imc_logout( ic, TRUE );  		return FALSE;  	}  	else if( st > 0 ) @@ -160,7 +160,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  		if( xt_feed( jd->xt, buf, st ) < 0 )  		{  			imc_error( ic, "XML stream error" ); -			imc_logout( ic ); +			imc_logout( ic, TRUE );  			return FALSE;  		} @@ -204,7 +204,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  					{  						imc_error( ic, "TLS is turned on for this "  						          "account, but is not supported by this server" ); -						imc_logout( ic ); +						imc_logout( ic, FALSE );  						return FALSE;  					}  					else @@ -216,7 +216,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  			else  			{  				imc_error( ic, "XML stream error" ); -				imc_logout( ic ); +				imc_logout( ic, TRUE );  				return FALSE;  			}  		} @@ -227,7 +227,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  		jd->fd = -1;  		imc_error( ic, "Error while reading from server" ); -		imc_logout( ic ); +		imc_logout( ic, TRUE );  		return FALSE;  	} @@ -242,7 +242,7 @@ gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition c  	if( source == -1 )  	{  		imc_error( ic, "Could not connect to server" ); -		imc_logout( ic ); +		imc_logout( ic, TRUE );  		return FALSE;  	} @@ -263,7 +263,7 @@ gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition co  		jd->ssl = NULL;  		imc_error( ic, "Could not connect to server" ); -		imc_logout( ic ); +		imc_logout( ic, TRUE );  		return FALSE;  	} @@ -274,7 +274,7 @@ gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition co  static xt_status jabber_end_of_stream( struct xt_node *node, gpointer data )  { -	imc_logout( data ); +	imc_logout( data, TRUE );  	return XT_ABORT;  } @@ -297,7 +297,7 @@ static xt_status jabber_pkt_features( struct xt_node *node, gpointer data )  		if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) )  		{  			imc_error( ic, "Server requires TLS connections, but TLS is turned off for this account" ); -			imc_logout( ic ); +			imc_logout( ic, FALSE );  			return XT_ABORT;  		} @@ -327,7 +327,7 @@ static xt_status jabber_pkt_features( struct xt_node *node, gpointer data )  		if( !trytls && set_getbool( &ic->acc->set, "tls" ) )  		{  			imc_error( ic, "TLS is turned on for this account, but is not supported by this server" ); -			imc_logout( ic ); +			imc_logout( ic, FALSE );  			return XT_ABORT;  		} @@ -428,6 +428,7 @@ static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data )  	struct im_connection *ic = data;  	struct xt_node *c;  	char *s, *type = NULL, *text = NULL; +	int allow_reconnect = TRUE;  	for( c = node->children; c; c = c->next )  	{ @@ -452,7 +453,7 @@ static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data )  	if( type == NULL )  	{  		imc_error( ic, "Unknown stream error reported by server" ); -		imc_logout( ic ); +		imc_logout( ic, allow_reconnect );  		return XT_ABORT;  	} @@ -462,14 +463,14 @@ static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data )  	if( strcmp( type, "conflict" ) == 0 )  	{  		imc_error( ic, "Account and resource used from a different location" ); -		ic->wants_to_die = TRUE; +		allow_reconnect = FALSE;  	}  	else  	{  		imc_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );  	} -	imc_logout( ic ); +	imc_logout( ic, allow_reconnect );  	return XT_ABORT;  } | 
