Changeset 4e1be76


Ignore:
Timestamp:
2010-09-04T17:23:46Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
975708a
Parents:
27053b5
Message:

Clean up any stuff stuck in the soap queue at disconnect time.

Location:
protocols/msn
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r27053b5 r4e1be76  
    9292               
    9393                msn_msgq_purge( ic, &md->msgq );
     94                msn_soapq_flush( ic, FALSE );
    9495               
    9596                for( i = 0; i < sizeof( md->tokens ) / sizeof( md->tokens[0] ); i ++ )
  • protocols/msn/soap.c

    r27053b5 r4e1be76  
    6969
    7070static int msn_soap_send_request( struct msn_soap_req_data *req );
     71static void msn_soap_free( struct msn_soap_req_data *soap_req );
    7172static void msn_soap_debug_print( const char *headers, const char *payload );
    7273
     
    127128        if( g_slist_find( msn_connections, soap_req->ic ) == NULL )
    128129        {
    129                 soap_req->free_data( soap_req );
    130                 g_free( soap_req->url );
    131                 g_free( soap_req->action );
    132                 g_free( soap_req->payload );
    133                 g_free( soap_req );
     130                msn_soap_free( soap_req );
    134131                return;
    135132        }
     
    232229}
    233230
    234 static int msn_soapq_empty( struct im_connection *ic )
     231int msn_soapq_flush( struct im_connection *ic, gboolean resend )
    235232{
    236233        struct msn_data *md = ic->proto_data;
     
    238235        while( md->soapq )
    239236        {
    240                 msn_soap_send_request( (struct msn_soap_req_data*) md->soapq->data );
     237                if( resend )
     238                        msn_soap_send_request( (struct msn_soap_req_data*) md->soapq->data );
     239                else
     240                        msn_soap_free( (struct msn_soap_req_data*) md->soapq->data );
    241241                md->soapq = g_slist_remove( md->soapq, md->soapq->data );
    242242        }
    243243       
    244244        return MSN_SOAP_OK;
     245}
     246
     247static void msn_soap_free( struct msn_soap_req_data *soap_req )
     248{
     249        soap_req->free_data( soap_req );
     250        g_free( soap_req->url );
     251        g_free( soap_req->action );
     252        g_free( soap_req->payload );
     253        g_free( soap_req );
    245254}
    246255
     
    370379       
    371380        if( md->soapq )
    372                 return msn_soapq_empty( ic );
     381                return msn_soapq_flush( ic, TRUE );
    373382       
    374383        if( sd->secret == NULL )
  • protocols/msn/soap.h

    r27053b5 r4e1be76  
    4343#endif
    4444#include "nogaim.h"
     45
     46
     47int msn_soapq_flush( struct im_connection *ic, gboolean resend );
    4548
    4649
Note: See TracChangeset for help on using the changeset viewer.