version 1.1.2.8, 2011/12/05 10:37:17
|
version 1.1.2.9, 2011/12/05 14:11:47
|
Line 8 static void *
|
Line 8 static void *
|
startSession(sched_task_t *task) |
startSession(sched_task_t *task) |
{ |
{ |
static u_char basebuf[USHRT_MAX]; |
static u_char basebuf[USHRT_MAX]; |
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; | mqtt_msg_t *buf; |
int len, ret = 0; | int ret = 0; |
|
|
FTRACE(4); |
FTRACE(4); |
|
|
Line 28 startSession(sched_task_t *task)
|
Line 27 startSession(sched_task_t *task)
|
VERB(3) syslog(LOG_ERR, "Error:: recv(%d) #%d - %s", (int) TASK_FD(task), |
VERB(3) syslog(LOG_ERR, "Error:: recv(%d) #%d - %s", (int) TASK_FD(task), |
errno, strerror(errno)); |
errno, strerror(errno)); |
goto end; |
goto end; |
} else | } |
hdr = (struct mqtthdr*) basebuf; | |
if (hdr->mqtt_msg.type != MQTT_TYPE_CONNECT) { | |
VERB(2) syslog(LOG_ERR, "Error:: wrong command type for 1st command #%d", | |
hdr->mqtt_msg.type); | |
goto end; | |
} else | |
len = mqtt_decodeLen(hdr->mqtt_len, &ret); | |
|
|
/* |
/* |
for (ret = i = 0; cliCmd[i] && !(ret = (hdr->mqtt_msg.type == cliCmd[i])); i++); |
for (ret = i = 0; cliCmd[i] && !(ret = (hdr->mqtt_msg.type == cliCmd[i])); i++); |
Line 50 startSession(sched_task_t *task)
|
Line 42 startSession(sched_task_t *task)
|
// ChkSessPUB(&cfg, ); |
// ChkSessPUB(&cfg, ); |
|
|
ret = mqttDispatcher(cbs, buf); |
ret = mqttDispatcher(cbs, buf); |
mqtt_msgFree(&buf, 42); | // mqtt_msgFree(&buf, 42); |
|
|
switch (ret) { |
switch (ret) { |
case -1: |
case -1: |