Changeset b79308b for protocols/jabber


Ignore:
Timestamp:
2008-04-14T13:10:53Z (16 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
0cab388
Parents:
6cac643 (diff), aa31117 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged in upstream r379 (somewhere after 1.2-3).
Just one trivial conflict in the jabber Makefile, went smoothly.

Location:
protocols/jabber
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/Makefile

    r6cac643 rb79308b  
    1010
    1111# [SH] Program variables
    12 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o xmltree.o si.o s5bytestream.o
     12objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o si.o s5bytestream.o
    1313
    1414CFLAGS += -Wall
     
    1818all: jabber_mod.o
    1919check: all
    20 lcov:
     20lcov: check
    2121gcov:
    2222        gcov *.c
  • protocols/jabber/io.c

    r6cac643 rb79308b  
    241241        }
    242242       
    243         /* EAGAIN/etc or a successful read. */
    244         return TRUE;
     243        if( ssl_pending( jd->ssl ) )
     244                /* OpenSSL empties the TCP buffers completely but may keep some
     245                   data in its internap buffers. select() won't see that, but
     246                   ssl_pending() does. */
     247                return jabber_read_callback( data, fd, cond );
     248        else
     249                return TRUE;
    245250}
    246251
     
    521526           from the server too. */
    522527        xt_free( jd->xt );      /* In case we're RE-starting. */
    523         jd->xt = xt_new( ic );
    524         jd->xt->handlers = (struct xt_handler_entry*) jabber_handlers;
     528        jd->xt = xt_new( jabber_handlers, ic );
    525529       
    526530        if( jd->r_inpa <= 0 )
  • protocols/jabber/iq.c

    r6cac643 rb79308b  
    534534}
    535535
     536static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
     537
    536538int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name )
    537539{
     
    549551        xt_add_attr( node, "xmlns", XMLNS_ROSTER );
    550552        node = jabber_make_packet( "iq", "set", NULL, node );
     553        jabber_cache_add( ic, node, jabber_add_to_roster_callback );
    551554       
    552555        st = jabber_write_packet( ic, node );
    553556       
    554         xt_free_node( node );
    555557        return st;
     558}
     559
     560static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
     561{
     562        char *s, *jid = NULL;
     563        struct xt_node *c;
     564       
     565        if( ( c = xt_find_node( orig->children, "query" ) ) &&
     566            ( c = xt_find_node( c->children, "item" ) ) &&
     567            ( jid = xt_find_attr( c, "jid" ) ) &&
     568            ( s = xt_find_attr( node, "type" ) ) &&
     569            strcmp( s, "result" ) == 0 )
     570        {
     571                if( imcb_find_buddy( ic, jid ) == NULL )
     572                        imcb_add_buddy( ic, jid, NULL );
     573        }
     574        else
     575        {
     576                imcb_log( ic, "Error while adding `%s' to your contact list.",
     577                          jid ? jid : "(unknown handle)" );
     578        }
     579       
     580        return XT_HANDLED;
    556581}
    557582
  • protocols/jabber/jabber.c

    r6cac643 rb79308b  
    267267        xt_free( jd->xt );
    268268       
     269        g_free( jd->cached_id_prefix );
    269270        g_free( jd->away_message );
    270271        g_free( jd->username );
  • protocols/jabber/jabber_util.c

    r6cac643 rb79308b  
    250250};
    251251
    252 static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla )
    253 {
     252static void jabber_buddy_ask_yes( void *data )
     253{
     254        struct jabber_buddy_ask_data *bla = data;
     255       
    254256        presence_send_request( bla->ic, bla->handle, "subscribed" );
    255257       
     
    261263}
    262264
    263 static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla )
    264 {
     265static void jabber_buddy_ask_no( void *data )
     266{
     267        struct jabber_buddy_ask_data *bla = data;
     268       
    265269        presence_send_request( bla->ic, bla->handle, "subscribed" );
    266270       
  • protocols/jabber/sasl.c

    r6cac643 rb79308b  
    2121*                                                                           *
    2222\***************************************************************************/
     23
     24#include <ctype.h>
    2325
    2426#include "jabber.h"
     
    107109}
    108110
    109 static char *sasl_get_part( char *data, char *field )
     111/* Non-static function, but not mentioned in jabber.h because it's for internal
     112   use, just that the unittest should be able to reach it... */
     113char *sasl_get_part( char *data, char *field )
    110114{
    111115        int i, len;
    112116       
    113117        len = strlen( field );
     118       
     119        while( isspace( *data ) || *data == ',' )
     120                data ++;
    114121       
    115122        if( g_strncasecmp( data, field, len ) == 0 && data[len] == '=' )
     
    129136                        }
    130137                       
    131                         /* If we got a comma, we got a new field. Check it. */
    132                         if( data[i] == ',' &&
    133                             g_strncasecmp( data + i + 1, field, len ) == 0 &&
    134                             data[i+len+1] == '=' )
     138                        /* If we got a comma, we got a new field. Check it,
     139                           find the next key after it. */
     140                        if( data[i] == ',' )
    135141                        {
    136                                 i += len + 2;
    137                                 break;
     142                                while( isspace( data[i] ) || data[i] == ',' )
     143                                        i ++;
     144                               
     145                                if( g_strncasecmp( data + i, field, len ) == 0 &&
     146                                    data[i+len] == '=' )
     147                                {
     148                                        i += len + 1;
     149                                        break;
     150                                }
    138151                        }
    139152                }
Note: See TracChangeset for help on using the changeset viewer.