version 1.2.2.17, 2012/04/26 08:20:20
|
version 1.2.2.22, 2012/05/03 15:05:37
|
Line 126 stopSession(struct tagSession *sess)
|
Line 126 stopSession(struct tagSession *sess)
|
free(msg.msg_base); |
free(msg.msg_base); |
|
|
ioDEBUG(1, "Close socket=%d", sess->sess_sock); |
ioDEBUG(1, "Close socket=%d", sess->sess_sock); |
finiSession(sess); |
|
|
|
call.LOG(logg, "Session %s stopped from %s for user %s.\n", sess->sess_cid, |
call.LOG(logg, "Session %s stopped from %s for user %s.\n", sess->sess_cid, |
sess->sess_addr, sess->sess_user); |
sess->sess_addr, sess->sess_user); |
|
|
|
finiSession(sess); |
} |
} |
|
|
static void * |
static void * |
Line 176 thrSession(struct tagSession *sess)
|
Line 176 thrSession(struct tagSession *sess)
|
finiSession(sess); |
finiSession(sess); |
locKill ^= locKill; |
locKill ^= locKill; |
continue; |
continue; |
|
case MQTT_TYPE_SUBSCRIBE: |
|
case MQTT_TYPE_PINGREQ: |
|
break; |
case MQTT_TYPE_PUBLISH: |
case MQTT_TYPE_PUBLISH: |
ioDEBUG(5, "Exec PUBLISH topic QoS=%d", hdr->mqtt_msg.qos); |
ioDEBUG(5, "Exec PUBLISH topic QoS=%d", hdr->mqtt_msg.qos); |
/* |
/* |
Line 185 thrSession(struct tagSession *sess)
|
Line 188 thrSession(struct tagSession *sess)
|
break; |
break; |
case MQTT_TYPE_PUBREL: |
case MQTT_TYPE_PUBREL: |
break; |
break; |
case MQTT_TYPE_SUBSCRIBE: |
|
break; |
|
case MQTT_TYPE_UNSUBSCRIBE: |
case MQTT_TYPE_UNSUBSCRIBE: |
break; |
break; |
case MQTT_TYPE_PINGREQ: |
|
ioDEBUG(5, "Exec PINGREQ session"); |
|
break; |
|
case MQTT_TYPE_PINGRESP: |
|
ioDEBUG(5, "Exec PINGRESP session"); |
|
break; |
|
default: |
default: |
ioDEBUG(5, "Error:: Session %s, wrong command %d - DISCARDED", |
ioDEBUG(5, "Error:: Session %s, wrong command %d - DISCARDED", |
sess->sess_cid, hdr->mqtt_msg.type); |
sess->sess_cid, hdr->mqtt_msg.type); |
Line 341 acceptClient(sched_task_t *task)
|
Line 336 acceptClient(sched_task_t *task)
|
if ((cli = accept(TASK_FD(task), &sa.sa, &sslen)) == -1) |
if ((cli = accept(TASK_FD(task), &sa.sa, &sslen)) == -1) |
goto end; |
goto end; |
else |
else |
fcntl(TASK_FD(task), F_SETFL, fcntl(TASK_FD(task), F_GETFL, 0) | O_NONBLOCK); | fcntl(cli, F_SETFL, fcntl(cli, F_GETFL, 0) | O_NONBLOCK); |
|
|
v = io_allocVar(); |
v = io_allocVar(); |
if (!v) { |
if (!v) { |
Line 362 acceptClient(sched_task_t *task)
|
Line 357 acceptClient(sched_task_t *task)
|
ioDEBUG(1, "Terminated client with socket=%d", cli); |
ioDEBUG(1, "Terminated client with socket=%d", cli); |
} |
} |
end: |
end: |
if (!schedRead(TASK_ROOT(task), acceptClient, NULL, TASK_FD(task), NULL, 0)) | if (!schedRead(root, acceptClient, NULL, TASK_FD(task), NULL, 0)) |
ioLIBERR(sched); |
ioLIBERR(sched); |
return NULL; |
return NULL; |
} |
} |
Line 394 Run(int sock)
|
Line 389 Run(int sock)
|
|
|
schedPolling(root, &pl, NULL); |
schedPolling(root, &pl, NULL); |
schedRun(root, &Kill); |
schedRun(root, &Kill); |
sleep(1); |
|
|
|
pthread_attr_destroy(&attr); |
pthread_attr_destroy(&attr); |
|
|