version 1.2.2.9, 2012/04/24 13:54:50
|
version 1.2.2.10, 2012/04/25 07:37:16
|
Line 6
|
Line 6
|
|
|
|
|
static void *startSession(sched_task_t *task); |
static void *startSession(sched_task_t *task); |
|
static pthread_attr_t attr; |
|
|
|
|
static inline struct tagSession * |
static inline struct tagSession * |
Line 281 startSession(sched_task_t *task)
|
Line 282 startSession(sched_task_t *task)
|
mqtthdr_connack_t cack; |
mqtthdr_connack_t cack; |
struct tagSession *s, *sess = NULL; |
struct tagSession *s, *sess = NULL; |
int ret; |
int ret; |
pthread_attr_t attr; |
|
|
|
ioTRACE(4); |
ioTRACE(4); |
|
|
Line 366 startSession(sched_task_t *task)
|
Line 366 startSession(sched_task_t *task)
|
} |
} |
|
|
/* Start session thread OK ... */ |
/* Start session thread OK ... */ |
pthread_attr_init(&attr); |
|
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); |
|
|
|
SESS_LOCK; |
SESS_LOCK; |
TAILQ_INSERT_TAIL(&Sessions, sess, sess_node); |
TAILQ_INSERT_TAIL(&Sessions, sess, sess_node); |
pthread_create(&sess->sess_tid, &attr, (void*(*)(void*)) thrSession, sess); |
pthread_create(&sess->sess_tid, &attr, (void*(*)(void*)) thrSession, sess); |
Line 376 startSession(sched_task_t *task)
|
Line 373 startSession(sched_task_t *task)
|
|
|
call.LOG(logg, "Session %s started from %s for user %s (timeout=%d) OK!\n", sess->sess_cid, |
call.LOG(logg, "Session %s started from %s for user %s (timeout=%d) OK!\n", sess->sess_cid, |
sess->sess_addr, sess->sess_user, sess->sess_ka); |
sess->sess_addr, sess->sess_user, sess->sess_ka); |
|
|
pthread_attr_destroy(&attr); |
|
return NULL; |
return NULL; |
end: /* close client connection */ |
end: /* close client connection */ |
ret = mqtt_msgCONNACK(&msg, ret); |
ret = mqtt_msgCONNACK(&msg, ret); |
Line 456 Run(int sock)
|
Line 451 Run(int sock)
|
return -1; |
return -1; |
} |
} |
|
|
|
pthread_attr_init(&attr); |
|
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); |
|
|
schedPolling(root, &pl, NULL); |
schedPolling(root, &pl, NULL); |
schedRun(root, &Kill); |
schedRun(root, &Kill); |
|
|
|
pthread_attr_destroy(&attr); |
|
|
/* free all undeleted elements into lists */ |
/* free all undeleted elements into lists */ |
PUBS_LOCK; |
PUBS_LOCK; |