version 1.2.2.29, 2012/05/08 14:27:46
|
version 1.2.2.30, 2012/05/08 14:36:10
|
Line 244 startSession(sched_task_t *task)
|
Line 244 startSession(sched_task_t *task)
|
ret = MQTT_RETCODE_ACCEPTED; |
ret = MQTT_RETCODE_ACCEPTED; |
} |
} |
|
|
|
/* db management */ |
if (call.FiniSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, "%") > 0) { |
if (call.FiniSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, "%") > 0) { |
ioDEBUG(2, "Old session %s should be disconnect!", sess->sess_cid); |
ioDEBUG(2, "Old session %s should be disconnect!", sess->sess_cid); |
TAILQ_FOREACH(s, &Sessions, sess_node) |
TAILQ_FOREACH(s, &Sessions, sess_node) |
Line 253 startSession(sched_task_t *task)
|
Line 254 startSession(sched_task_t *task)
|
break; |
break; |
} |
} |
} |
} |
|
|
if (call.InitSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, sess->sess_addr, |
if (call.InitSessPUB(&cfg, pub, sess->sess_cid, sess->sess_user, sess->sess_addr, |
sess->sess_will.flag, sess->sess_will.topic, sess->sess_will.msg, |
sess->sess_will.flag, sess->sess_will.topic, sess->sess_will.msg, |
sess->sess_will.qos, sess->sess_will.retain) == -1) { |
sess->sess_will.qos, sess->sess_will.retain) == -1) { |
Line 264 startSession(sched_task_t *task)
|
Line 264 startSession(sched_task_t *task)
|
ioDEBUG(0, "Session %s from %s and username %s is started", |
ioDEBUG(0, "Session %s from %s and username %s is started", |
sess->sess_cid, sess->sess_addr, sess->sess_user); |
sess->sess_cid, sess->sess_addr, sess->sess_user); |
ret = MQTT_RETCODE_ACCEPTED; |
ret = MQTT_RETCODE_ACCEPTED; |
|
} |
|
/* clean/load session if requested */ |
|
if (sess->sess_clean) { |
|
if (call.DeletePUB_subscribe) |
|
call.DeletePUB_subscribe(&cfg, pub, sess->sess_cid, "%", sess->sess_user, "%"); |
|
if (call.WipePUB_topic) |
|
call.WipePUB_topic(&cfg, pub, sess->sess_cid, sess->sess_user, -1); |
|
} else { |
|
// todo: read_sql subs and prepare publish |
} |
} |
|
|
/* Start session task OK ... */ |
/* Start session task OK ... */ |