|
|
| version 1.2.2.5, 2012/04/26 07:25:00 | version 1.2.2.6, 2012/04/26 08:20:20 |
|---|---|
| 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; |
| #if 0 | ioDEBUG(5, "Exec CONNECT session"); |
| SESS_LOCK; | SESS_LOCK; |
| TAILQ_REMOVE(&Sessions, sess, sess_node); | TAILQ_REMOVE(&Sessions, sess, sess_node); |
| SESS_UNLOCK; | SESS_UNLOCK; |
| Line 128 cmdCONNECT(void *srv, void *arg) | Line 127 cmdCONNECT(void *srv, void *arg) |
| call.FiniSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, "%"); | call.FiniSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, "%"); |
| SESS_ELEM_LOCK(sess); | SESS_ELEM_LOCK(sess); |
| for (i = 0; i < MQTT_QOS_RESERVED; i++) | while ((store = SLIST_FIRST(&sess->sess_subscr))) { |
| while ((store = SLIST_FIRST(&sess->sess_txque[i]))) { | SLIST_REMOVE_HEAD(&sess->sess_subscr, st_node); |
| 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); |
| } | } |
| SESS_ELEM_UNLOCK(sess); | SESS_ELEM_UNLOCK(sess); |
| if (sess->sess_will.msg) | if (sess->sess_will.msg) |
| Line 148 cmdCONNECT(void *srv, void *arg) | Line 146 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; |
| } | } |