diff options
Diffstat (limited to 'agni.c')
-rw-r--r-- | agni.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -485,6 +485,7 @@ int th_start_client(void *data) //wrong tble_cmd_resp *match_resp = malloc(sizeof(tble_cmd_resp)); + memset(match_resp, 0, sizeof(tble_cmd_resp)); if (match_resp != NULL) { PNL(); @@ -496,14 +497,14 @@ int th_start_client(void *data) PNL(); //check if command match - //int cmd_id = tbl_qcmd_resp(qtbl, match_resp); - //if (cmd_id > 0) + int cmd_id = tbl_qcmd_resp(qtbl, match_resp); + if (cmd_id > 0) { PNL(); - // PRINT("%d\n",cmd_id); + PRINT("%d\n",cmd_id); } - tbl_cmd_param_free(match_resp); + tbl_cmd_resp_free(match_resp); } //lets memleak here @@ -583,6 +584,7 @@ int th_start_client(void *data) qcmd->state = QCMD_NONE; qcmd->cmd = alloc_new_str("PRIVMSG"); qcmd->param = alloc_new_str(msg); + tbl_qcmd_add_tok(qcmd, itok); tbl_qcmd_add(qtbl, qcmd); tbl_qcmd_print_tbl(qtbl,TBL_PF_QCMD_ID |TBL_PF_QCMD_CID @@ -823,6 +825,9 @@ int th_event_manager(void *data) char msg[] = "Forever"; mq_cmd *privcmd = mq_cmd_create(mq_cmd_id(recv_cmd),"PRIVMSG",strlen("PRIVMSG"),msg,strlen(msg)); + int id = mq_cmd_id(recv_cmd); + PRINT("%d\n",id); + char *cmdBuf = mq_cmd_buf(privcmd); mq_ntf_write(mq, MQ_IN, cmdBuf, strlen(cmdBuf)); cmdBuf = NULL; |