version 1.2.2.30, 2012/05/08 14:36:10
|
version 1.2.2.31, 2012/05/14 13:04:14
|
Line 186 startSession(sched_task_t *task)
|
Line 186 startSession(sched_task_t *task)
|
mqtt_msg_t buf = { basebuf, sizeof basebuf }; |
mqtt_msg_t buf = { basebuf, sizeof basebuf }; |
mqtthdr_connflgs_t flg; |
mqtthdr_connflgs_t flg; |
mqtthdr_connack_t cack; |
mqtthdr_connack_t cack; |
|
ait_val_t *v; |
struct tagSession *s, *sess = NULL; |
struct tagSession *s, *sess = NULL; |
int ret, wlen; |
int ret, wlen; |
|
|
Line 194 startSession(sched_task_t *task)
|
Line 195 startSession(sched_task_t *task)
|
assert(task); |
assert(task); |
|
|
if (!TASK_DATA(task)) { |
if (!TASK_DATA(task)) { |
|
v = TASK_ARG(task); |
/* flow from accept new clients */ |
/* flow from accept new clients */ |
sess = initSession(TASK_FD(task), TASK_ARG(task)); | sess = initSession(TASK_FD(task), v); |
io_freeVar(TASK_ARG(task)); | io_freeVar(&v); |
if (!sess) { |
if (!sess) { |
close(TASK_FD(task)); |
close(TASK_FD(task)); |
return NULL; |
return NULL; |
Line 330 acceptClient(sched_task_t *task)
|
Line 332 acceptClient(sched_task_t *task)
|
ioDEBUG(1, "Connected client with socket=%d from %s", cli, AIT_GET_STR(v)); |
ioDEBUG(1, "Connected client with socket=%d from %s", cli, AIT_GET_STR(v)); |
|
|
if (!schedRead(root, startSession, v, cli, NULL, 0)) { |
if (!schedRead(root, startSession, v, cli, NULL, 0)) { |
io_freeVar(v); | io_freeVar(&v); |
close(cli); |
close(cli); |
ioDEBUG(1, "Terminated client with socket=%d", cli); |
ioDEBUG(1, "Terminated client with socket=%d", cli); |
} |
} |