Diff for /mqtt/src/mqttd_calls.c between versions 1.2.2.2 and 1.2.2.5

version 1.2.2.2, 2012/01/30 13:39:22 version 1.2.2.5, 2012/04/26 07:25:00
Line 112  cmdCONNECT(void *srv, void *arg) Line 112  cmdCONNECT(void *srv, void *arg)
 {  {
         struct tagStore *store;          struct tagStore *store;
         struct tagSession *sess = (struct tagSession*) arg;          struct tagSession *sess = (struct tagSession*) arg;
           register int i;
   
         ioTRACE(2);          ioTRACE(2);
   
         if (!sess)          if (!sess)
                 return -1;                  return -1;
   
        pthread_mutex_lock(&mtx_sess);#if 0
         SESS_LOCK;
         TAILQ_REMOVE(&Sessions, sess, sess_node);          TAILQ_REMOVE(&Sessions, sess, sess_node);
        pthread_mutex_unlock(&mtx_sess);        SESS_UNLOCK;
   
         if (call.FiniSessPUB)          if (call.FiniSessPUB)
                 call.FiniSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, "%");                  call.FiniSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, "%");
   
        pthread_mutex_lock(&sess->sess_mtx);        SESS_ELEM_LOCK(sess);
        while ((store = TAILQ_FIRST(&sess->sess_sndqueue))) {        for (i = 0; i < MQTT_QOS_RESERVED; i++)
                TAILQ_REMOVE(&sess->sess_sndqueue, store, st_node);                while ((store = SLIST_FIRST(&sess->sess_txque[i]))) {
                         SLIST_REMOVE_HEAD(&sess->sess_txque[i], st_node);
   
                if (store->st_subscr.sub_topic.msg_base)                        if (store->st_subscr.sub_topic.msg_base)
                        free(store->st_subscr.sub_topic.msg_base);                                free(store->st_subscr.sub_topic.msg_base);
                if (store->st_subscr.sub_value.msg_base)                        if (store->st_subscr.sub_value.msg_base)
                        free(store->st_subscr.sub_value.msg_base);                                free(store->st_subscr.sub_value.msg_base);
   
                free(store);                        free(store);
        }                }
        pthread_mutex_unlock(&sess->sess_mtx);        SESS_ELEM_UNLOCK(sess);
   
         if (sess->sess_will.msg)          if (sess->sess_will.msg)
                 free(sess->sess_will.msg);                  free(sess->sess_will.msg);
Line 145  cmdCONNECT(void *srv, void *arg) Line 148  cmdCONNECT(void *srv, void *arg)
   
         call.LOG(logg, "Session %s stopped from %s for user %s.\n", sess->sess_cid,           call.LOG(logg, "Session %s stopped from %s for user %s.\n", sess->sess_cid, 
                         sess->sess_addr, sess->sess_user);                          sess->sess_addr, sess->sess_user);
   #endif
         return 0;          return 0;
 }  }
   
Line 158  cmdDISCONNECT(void *srv, void *arg) Line 162  cmdDISCONNECT(void *srv, void *arg)
         if (!sess)          if (!sess)
                 return -1;                  return -1;
   
        pthread_mutex_lock(&mtx_sess);        ioDEBUG(5, "Exec DISCONNECT session");
         SESS_LOCK;
         TAILQ_REMOVE(&Sessions, sess, sess_node);          TAILQ_REMOVE(&Sessions, sess, sess_node);
        pthread_mutex_unlock(&mtx_sess);        SESS_UNLOCK;
   
         call.LOG(logg, "Session %s stopped from %s for user %s.\n", sess->sess_cid,           call.LOG(logg, "Session %s stopped from %s for user %s.\n", sess->sess_cid, 
                         sess->sess_addr, sess->sess_user);                          sess->sess_addr, sess->sess_user);

Removed from v.1.2.2.2  
changed lines
  Added in v.1.2.2.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>