version 1.2.2.3, 2012/01/30 08:29:55
|
version 1.2.2.4, 2012/01/30 13:39:22
|
Line 27 initSession(int sock, ait_val_t * __restrict v)
|
Line 27 initSession(int sock, ait_val_t * __restrict v)
|
} else |
} else |
memset(sess, 0, sizeof(struct tagSession)); |
memset(sess, 0, sizeof(struct tagSession)); |
|
|
|
pthread_mutex_init(&sess->sess_mtx, NULL); |
|
|
TAILQ_INIT(&sess->sess_sndqueue); |
TAILQ_INIT(&sess->sess_sndqueue); |
|
|
str = (const char*) cfg_GetAttribute(&cfg, CFG("mqttd"), CFG("retry")); |
str = (const char*) cfg_GetAttribute(&cfg, CFG("mqttd"), CFG("retry")); |
Line 79 finiSession(struct tagSession *sess, int preservSock)
|
Line 81 finiSession(struct tagSession *sess, int preservSock)
|
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); |
while ((store = TAILQ_FIRST(&sess->sess_sndqueue))) { |
while ((store = TAILQ_FIRST(&sess->sess_sndqueue))) { |
TAILQ_REMOVE(&sess->sess_sndqueue, store, st_node); |
TAILQ_REMOVE(&sess->sess_sndqueue, store, st_node); |
|
|
Line 89 finiSession(struct tagSession *sess, int preservSock)
|
Line 92 finiSession(struct tagSession *sess, int preservSock)
|
|
|
free(store); |
free(store); |
} |
} |
|
pthread_mutex_unlock(&sess->sess_mtx); |
|
pthread_mutex_destroy(&sess->sess_mtx); |
|
|
if (sess->sess_will.msg) |
if (sess->sess_will.msg) |
free(sess->sess_will.msg); |
free(sess->sess_will.msg); |
Line 246 thrSession(struct tagSession *sess)
|
Line 251 thrSession(struct tagSession *sess)
|
case MQTT_TYPE_UNSUBSCRIBE: |
case MQTT_TYPE_UNSUBSCRIBE: |
break; |
break; |
case MQTT_TYPE_PINGREQ: |
case MQTT_TYPE_PINGREQ: |
|
ioDEBUG(5, "Exec PINGREQ session"); |
break; |
break; |
default: |
default: |
ioDEBUG(5, "Error:: Session %s, wrong command %d - DISCARDED", |
ioDEBUG(5, "Error:: Session %s, wrong command %d - DISCARDED", |