openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/obj.c
static rsRetVal objDeserializeTryRecover(strm_t* pStrm)
{
    DEFiRet;
    uchar c;
    int bWasNL;
    int bRun;

    assert(pStrm != NULL);
    bRun = 1;
    bWasNL = 0;

    while (bRun)
    {
        NEXTC;
        if (c == '\n')
            bWasNL = 1;
        else
        {
            if (bWasNL == 1 && c == COOKIE_OBJLINE)
                bRun = 0; /* we found it! */
            else
                bWasNL = 0;
        }
    }

    CHKiRet(strm.UnreadChar(pStrm, c));

finalize_it:
    dbgprintf("deserializer has possibly been able to re-sync and recover, "
              "state %d\n",
              iRet);
    RETiRet;
}
/* This method tries to recover a serial store if it got out of sync.
 * To do so, it scans the line beginning cookies and waits for the object
 * cookie. If that is found, control is returned. If the store is exhausted,
 * we will receive an RS_RET_EOF error as part of NEXTC, which will also
 * terminate this function. So we may either return with somehting that
 * looks like a valid object or end of store.
 * rgerhards, 2008-01-07
 */
This method tries to recover a serial store if it got out of sync.
To do so, it scans the line beginning cookies and waits for the object
cookie. If that is found, control is returned. If the store is exhausted,
we will receive an RS_RET_EOF error as part of NEXTC, which will also
terminate this function. So we may either return with somehting that
looks like a valid object or end of store.
This method tries to recover a serial store if it got out of sync . To do so it scans the line beginning cookies and waits for the object cookie . If that is found control is returned . If the store is exhausted we will receive an RS_RET_EOF error as part of NEXTC which will also terminate this function . So we may either return with somehting that looks like a valid object or end of store .
static rsRetVal objDeserializeTryRecover(strm_t* pStrm)
{
    DEFiRet;
    uchar c;
    int bWasNL;
    int bRun;
    assert(pStrm != NULL);
    bRun = 1;
    bWasNL = 0;
    while (bRun)
    {
        NEXTC;
        if (c == '\n')
            bWasNL = 1;
        else
        {
            if (bWasNL == 1 && c == COOKIE_OBJLINE)
                bRun = 0; 
            else
                bWasNL = 0;
        }
    }
    CHKiRet(strm.UnreadChar(pStrm, c));
finalize_it:
    dbgprintf("deserializer has possibly been able to re-sync and recover, "
              "state %d\n",
              iRet);
    RETiRet;
}
static rsRetVal objDeserializeTryRecover ( strm_t * pStrm ) { DEFiRet ; uchar c ; int bWasNL ; int bRun ; assert ( pStrm != NULL ) ; bRun = 1 ; bWasNL = 0 ; while ( bRun ) { NEXTC ; if ( c == ' \n ' ) bWasNL = 1 ; else { if ( bWasNL == 1 && c == COOKIE_OBJLINE ) bRun = 0 ; else bWasNL = 0 ; } } CHKiRet ( strm . UnreadChar ( pStrm , c ) ) ; finalize_it : dbgprintf ( " " " \n " , iRet ) ; RETiRet ; }
This method tries to recover a serial store if it got out of sync.
This method tries to recover a serial store if it got out of sync .
/* we found it! */