add clear_errorstack(PEP_SESSION) to clear the errorstack but keep the session
authorRoker <roker@pep-project.org>
Fri, 12 May 2017 10:39:17 +0200
changeset 1777a537bef47d07
parent 1776 43db1100ebd2
child 1778 cc8e55efa24a
add clear_errorstack(PEP_SESSION) to clear the errorstack but keep the session
src/pEpEngine.c
src/pEpEngine.h
     1.1 --- a/src/pEpEngine.c	Thu May 11 17:39:31 2017 +0200
     1.2 +++ b/src/pEpEngine.c	Fri May 12 10:39:17 2017 +0200
     1.3 @@ -2334,19 +2334,30 @@
     1.4      return session->errorstack;
     1.5  }
     1.6  
     1.7 +DYNAMIC_API void clear_errorstack(PEP_SESSION session)
     1.8 +{
     1.9 +    free_stringlist(session->errorstack);
    1.10 +    session->errorstack = new_stringlist(NULL);
    1.11 +}
    1.12 +
    1.13  #else
    1.14  
    1.15  static stringlist_t* dummy_errorstack = NULL;
    1.16  
    1.17  DYNAMIC_API const stringlist_t* get_errorstack(PEP_SESSION session)
    1.18  {
    1.19 -	if(dummy_errorstack == NULL)
    1.20 -	{
    1.21 -		dummy_errorstack = new_stringlist("( Please recompile pEpEngine with -DDEBUG_ERRORSTACK )");
    1.22 -	}
    1.23 -	
    1.24 +    if(dummy_errorstack == NULL)
    1.25 +    {
    1.26 +        dummy_errorstack = new_stringlist("( Please recompile pEpEngine with -DDEBUG_ERRORSTACK )");
    1.27 +    }
    1.28 +
    1.29      return dummy_errorstack;
    1.30  }
    1.31  
    1.32 +DYNAMIC_API void clear_errorstack(PEP_SESSION session)
    1.33 +{
    1.34 +    // nothing to do here
    1.35 +}
    1.36 +
    1.37  #endif
    1.38  
     2.1 --- a/src/pEpEngine.h	Thu May 11 17:39:31 2017 +0200
     2.2 +++ b/src/pEpEngine.h	Fri May 12 10:39:17 2017 +0200
     2.3 @@ -157,6 +157,13 @@
     2.4  //        The error stack belongs to the session. Do no not change it!
     2.5  DYNAMIC_API const stringlist_t* get_errorstack(PEP_SESSION session);
     2.6  
     2.7 +// void clear_errorstack(PEP_SESSION) - clear the error stack for that session, if any
     2.8 +//
     2.9 +//  parameters:
    2.10 +//        session (in)    session handle
    2.11 +//
    2.12 +DYNAMIC_API void clear_errorstack(PEP_SESSION session);
    2.13 +
    2.14  
    2.15  // config_passive_mode() - enable passive mode
    2.16  //