Ignore:
Timestamp:
2006-09-22T16:56:58Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
fe7a554
Parents:
5997488
Message:

Fixed return value on incomplete write()s in write handler, protection
against write()ing to sockets that are closed already, hopefully sane
detection for SASL support, and only sending type=unavailable presence
tag to logged in sessions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/sasl.c

    r5997488 r8d74291  
    3434        char *s;
    3535        int sup_plain = 0, sup_digest = 0;
     36       
     37        if( !sasl_supported( gc ) )
     38        {
     39                /* Should abort this now, since we should already be doing
     40                   IQ authentication. Strange things happen when you try
     41                   to do both... */
     42                serv_got_crap( gc, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
     43                return XT_HANDLED;
     44        }
    3645       
    3746        s = xt_find_attr( node, "xmlns" );
     
    94103xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data )
    95104{
     105        return XT_HANDLED;
    96106}
    97107
     
    123133        return XT_HANDLED;
    124134}
     135
     136/* This one is needed to judge if we'll do authentication using IQ or SASL.
     137   It's done by checking if the <stream:stream> from the server has a
     138   version attribute. I don't know if this is the right way though... */
     139gboolean sasl_supported( struct gaim_connection *gc )
     140{
     141        struct jabber_data *jd = gc->proto_data;
     142       
     143        return ( jd->xt && jd->xt->root && xt_find_attr( jd->xt->root, "version" ) ) != NULL;
     144}
Note: See TracChangeset for help on using the changeset viewer.