Bug #269

tpchkunsol routine not working

Added by Abderrahime about 6 years ago. Updated about 6 years ago.

Status:ClosedStart 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.

#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!

Also available in: Atom PDF