Ignore:
Timestamp:
2006-10-12T17:48:58Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
a4effbf
Parents:
b56b220
Message:

Special message when the XMPP session is ended because of a concurrent
login, and now sending proper error responses to IQ packets we can't
handle.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    rb56b220 r259edd4  
    3030        struct xt_node *c, *reply = NULL;
    3131        char *type, *s;
    32         int st;
     32        int st, pack = 1;
    3333       
    3434        type = xt_find_attr( node, "type" );
     
    101101                {
    102102                        xt_free_node( reply );
    103                         reply = NULL;
    104                 }
    105                
    106                 /* If we recognized the xmlns and managed to generate a reply,
    107                    finish and send it. */
    108                 if( reply )
     103                        reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" );
     104                        pack = 0;
     105                }
     106        }
     107        else if( strcmp( type, "set" ) == 0 )
     108        {
     109                xt_free_node( reply );
     110                reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" );
     111                pack = 0;
     112        }
     113       
     114        /* If we recognized the xmlns and managed to generate a reply,
     115           finish and send it. */
     116        if( reply )
     117        {
     118                /* Normally we still have to pack it into an iq-result
     119                   packet, but for errors, for example, we don't. */
     120                if( pack )
    109121                {
    110122                        reply = jabber_make_packet( "iq", "result", xt_find_attr( node, "from" ), reply );
    111123                        if( ( s = xt_find_attr( node, "id" ) ) )
    112124                                xt_add_attr( reply, "id", s );
    113                        
    114                         st = jabber_write_packet( gc, reply );
    115                         xt_free_node( reply );
    116                         if( !st )
    117                                 return XT_ABORT;
    118                 }
     125                }
     126               
     127                st = jabber_write_packet( gc, reply );
     128                xt_free_node( reply );
     129                if( !st )
     130                        return XT_ABORT;
    119131        }
    120132       
Note: See TracChangeset for help on using the changeset viewer.