version 1.1.2.6, 2011/12/01 14:41:11
|
version 1.1.2.7, 2011/12/05 08:15:50
|
Line 1
|
Line 1
|
#include "global.h" |
#include "global.h" |
|
|
|
|
|
extern char cliCmd[], *cliStr[]; |
|
|
|
|
static void * |
static void * |
startSession(sched_task_t *task) |
startSession(sched_task_t *task) |
{ |
{ |
mqtt_msg_t *buf; |
mqtt_msg_t *buf; |
mqtt_cb_t cbs[MQTT_TYPE_MAX + 1] = { 0 }; |
mqtt_cb_t cbs[MQTT_TYPE_MAX + 1] = { 0 }; |
|
struct mqtthdr *hdr; |
int ret = 0; |
int ret = 0; |
|
register int i; |
|
|
FTRACE(4); |
FTRACE(4); |
|
|
Line 22 startSession(sched_task_t *task)
|
Line 27 startSession(sched_task_t *task)
|
errno, strerror(errno)); |
errno, strerror(errno)); |
mqtt_msgFree(&buf, 42); |
mqtt_msgFree(&buf, 42); |
goto end; |
goto end; |
|
} else { |
|
hdr = (struct mqtthdr*) buf->msg_base; |
|
for (ret = i = 0; cliCmd[i] && !(ret = (hdr->mqtt_msg.type == cliCmd[i])); i++); |
|
if (!ret) { |
|
syslog(LOG_ERR, "Error:: wrong command type #%d %s", |
|
hdr->mqtt_msg.type, cliStr[i]); |
|
mqtt_msgFree(&buf, 42); |
|
goto end; |
|
} |
} |
} |
|
|
ret = mqttDispatcher(cbs, buf); |
ret = mqttDispatcher(cbs, buf); |