--- mqtt/src/daemon.c 2011/12/14 15:09:31 1.1.2.20 +++ mqtt/src/daemon.c 2011/12/15 12:57:40 1.1.2.21 @@ -139,9 +139,12 @@ startSession(sched_task_t *task) if (call.LoginACC(&cfg, acc, sess->sess_user, sess->sess_pass) < 1) { ioDEBUG(0, "Login:: DENIED for username %s and password %s", sess->sess_user, sess->sess_pass); + ret = MQTT_RETCODE_DENIED; goto end; - } else + } else { ioDEBUG(0, "Login:: ALLOWED for username %s ...", sess->sess_user); + ret = MQTT_RETCODE_ACCEPTED; + } ret = mqtt_msgCONNACK(&msg, ret); if ((ret = send(sess->sess_sock, msg.msg_base, ret, 0)) == -1) { @@ -192,7 +195,6 @@ thrSched(void *arg __unused) ioTRACE(1); schedRun(root, &Kill); - printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); TAILQ_FOREACH(sess, &Sessions, sess_node) if (sess->sess_tid) @@ -241,15 +243,12 @@ Run(int sock) ioDEBUG(1, "Connected client with socket=%d from %s:%d", cli, AIT_GET_STR(v), io_n2port(&sa)); - /* if (!schedRead(root, startSession, v, cli)) { io_freeVar(v); close(cli); ioDEBUG(1, "Terminated client with socket=%d", cli); } - */ } - printf("rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr\n"); return 0; }