jingle/jingle.c
changeset 135 06b7c6f1c05c
parent 133 361d8577ebd1
child 139 459b2503c1a3
equal deleted inserted replaced
134:8c98308c139d 135:06b7c6f1c05c
   157   return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   157   return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   158 }
   158 }
   159 
   159 
   160 gboolean jingle_ack_timeout_checker(gpointer user_data)
   160 gboolean jingle_ack_timeout_checker(gpointer user_data)
   161 {
   161 {
   162   GSList *el;
   162   GSList *el, *prev;
   163   time_t now = time(NULL);
   163   time_t now = time(NULL);
   164   JingleAckHandle *ah;
   164   JingleAckHandle *ah;
   165 
   165 
   166   for (el = ack_handlers; el; el = g_slist_next(el)) {
   166   el = ack_handlers;
   167 	JingleAckHandle *ah = el->data;
   167   while(el) {
   168 
   168     JingleAckHandle *ah = el->data;
   169     if (ah->timeout == 0 || ah->_inserted + ah->timeout > now)
   169 
   170 	  continue;
   170     if (ah->timeout != 0 && ah->_inserted + ah->timeout <= now) {
   171 
   171       if (ah->callback != NULL) {
   172     if(ah->callback != NULL)
   172         ah->callback(JINGLE_ACK_TIMEOUT, NULL, ah->user_data);
   173       ah->callback(JINGLE_ACK_TIMEOUT, NULL, ah->user_data);
   173       }
   174 
   174 
   175     lm_message_handler_unref(ah->_handler);
   175       jingle_ack_handler_free(ah);
   176     jingle_ack_handler_free(ah);
   176       if (ack_handlers == NULL)
       
   177         break;
       
   178 
       
   179       el = prev;
       
   180     }
       
   181     prev = el;
       
   182     el = el->next;
   177   }
   183   }
   178   return TRUE;
   184   return TRUE;
   179 }
   185 }
   180 
   186 
   181 LmMessageHandler *jingle_new_ack_handler(JingleAckHandle *ah)
   187 LmMessageHandler *jingle_new_ack_handler(JingleAckHandle *ah)