Ignore:
Timestamp:
2010-11-21T15:23:54Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
495d21b
Parents:
bb151f7
Message:

Time out if logging in takes too long (2m for now). Except for Twitter
OAuth login, which requires user action. This mostly solves problems with
OSCAR login silently failing, but may also be useful in other places.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/account.c

    rbb151f7 r748bcdd  
    339339}
    340340
     341static gboolean account_on_timeout( gpointer d, gint fd, b_input_condition cond );
     342
    341343void account_on( bee_t *bee, account_t *a )
    342344{
     
    351353        a->reconnect = 0;
    352354        a->prpl->login( a );
     355       
     356        if( !( a->ic->flags & OPT_SLOW_LOGIN ) )
     357                a->ic->keepalive = b_timeout_add( 120000, account_on_timeout, a->ic );
    353358}
    354359
     
    362367                cancel_auto_reconnect( a );
    363368        }
     369}
     370
     371static gboolean account_on_timeout( gpointer d, gint fd, b_input_condition cond )
     372{
     373        struct im_connection *ic = d;
     374       
     375        imcb_error( ic, "Connection timeout" );
     376        imc_logout( ic, TRUE );
     377       
     378        return FALSE;
    364379}
    365380
Note: See TracChangeset for help on using the changeset viewer.