version 1.2.2.43, 2012/07/02 12:52:19
|
version 1.2.2.44, 2012/07/03 07:48:49
|
Line 70 finiSession(struct tagSession *sess)
|
Line 70 finiSession(struct tagSession *sess)
|
if (!sess) |
if (!sess) |
return; |
return; |
|
|
|
schedCancelby(root, taskTIMER, CRITERIA_CALL, sendRetain, NULL); |
|
|
if (sess->sess_clean) { |
if (sess->sess_clean) { |
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, "%"); |
Line 219 startSession(sched_task_t *task)
|
Line 221 startSession(sched_task_t *task)
|
struct tagSession *s, *sess = NULL; |
struct tagSession *s, *sess = NULL; |
int ret, wlen; |
int ret, wlen; |
mqtt_subscr_t *subs; |
mqtt_subscr_t *subs; |
|
struct timespec ts = { RETAIN_TIMEOUT, 0 }; |
|
|
ioTRACE(4); |
ioTRACE(4); |
|
|
Line 305 startSession(sched_task_t *task)
|
Line 308 startSession(sched_task_t *task)
|
if (call.WipePUB_topic) |
if (call.WipePUB_topic) |
call.WipePUB_topic(&cfg, pub, sess->sess_cid, sess->sess_user, -1); |
call.WipePUB_topic(&cfg, pub, sess->sess_cid, sess->sess_user, -1); |
} else if (call.ReadPUB_subscribe) { |
} else if (call.ReadPUB_subscribe) { |
|
/* load subscribes */ |
subs = call.ReadPUB_subscribe(&cfg, pub, sess->sess_cid, "%"); |
subs = call.ReadPUB_subscribe(&cfg, pub, sess->sess_cid, "%"); |
loadSubscribes(sess, subs); |
loadSubscribes(sess, subs); |
mqtt_subFree(&subs); |
mqtt_subFree(&subs); |
} |
} |
|
|
|
/* timer event for retain messages */ |
|
if (call.ReadPUB_topic) |
|
schedTimer(root, sendRetain, sess, ts, NULL, 0); |
|
|
/* Start session task OK ... */ |
/* Start session task OK ... */ |
if (!schedRead(root, dispatchSession, sess, TASK_FD(task), NULL, 0)) { |
if (!schedRead(root, dispatchSession, sess, TASK_FD(task), NULL, 0)) { |