Bug #269
tpchkunsol routine not working
Status: | Closed | Start date: | 01/02/2018 | |
---|---|---|---|---|
Priority: | Normal (Code 4) | Due date: | ||
Assignee: | - | % Done: | 100% | |
Category: | - | |||
Target version: | - |
Description
Hi,
the function tpchkunsol not return the number of unsolicitted messages du to a problem in the return of the function.
as indicated in the help of the routine :
Upon successful completion, tpchkunsol() returns the number of unsolicited messages dispatched; otherwise it returns -1 and sets tperrno() to indicate the error condition.
if we check the source code of the function file (endurox/libatmi/atmi.c) we found that there is no return for the function ndrx_tpchkunsol:
/** * Check unsolicited messages by client * @return FAIL */ expublic int tpchkunsol(void) { int ret=EXSUCCEED; int entry_status=EXSUCCEED; API_ENTRY; if (EXSUCCEED!=entry_status) { EXFAIL_OUT(ret); } * if (ndrx_tpchkunsol()<0)* { NDRX_LOG(log_error, "ndrx_tpchkunsol failed"); EXFAIL_OUT(ret); } out: return ret; }
as solution we can just get the return before check if the function fails or not :
/** * Check unsolicited messages by client * @return FAIL */ expublic int tpchkunsol(void) { int ret=EXSUCCEED; int entry_status=EXSUCCEED; API_ENTRY; if (EXSUCCEED!=entry_status) { EXFAIL_OUT(ret); } * ret = ndrx_tpchkunsol();* if (ret<0) { NDRX_LOG(log_error, "ndrx_tpchkunsol failed"); EXFAIL_OUT(ret); } out: return ret; }
History
#1 Updated by Madars about 6 years ago
- Description updated (diff)
#2 Updated by Madars about 6 years ago
- Description updated (diff)
#3 Updated by Madars about 6 years ago
Hi, Thanks for pointing out, I see the issue, Will fix this.
Also manpage needs to be updated
RETURN VALUE On success, tpcall() return zero; on error, −1 is returned, with tperrno set to indicate the error.
It speaks about tpcall, but must correspond to tpchkunsol().
This will go to version 5.2.6, will be done within this week.
#4 Updated by Madars about 6 years ago
Bug fixed and unit tested: https://github.com/endurox-dev/endurox/commit/d6c0c06b07842039c2b18baabce8edb52dbf10e8
Preparing release..
#5 Updated by Madars about 6 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
First portion of binaries attached.
#6 Updated by Madars about 6 years ago
- Status changed from Resolved to Closed
#7 Updated by Abderrahime about 6 years ago
Hi,
I tested the new release, the issue is fixed.
Thanks,
#8 Updated by Madars about 6 years ago
Glad to hear! Thanks!