removed errorstack cruft
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Wed, 05 Aug 2020 13:09:06 +0200
changeset 4923d37a3d3192ed
parent 4916 b4573e87c783
child 4924 d5645a8e68bd
removed errorstack cruft
src/pEpEngine.c
src/pEpEngine.h
src/pEp_internal.h
     1.1 --- a/src/pEpEngine.c	Fri Jul 31 00:18:09 2020 +0200
     1.2 +++ b/src/pEpEngine.c	Wed Aug 05 13:09:06 2020 +0200
     1.3 @@ -998,10 +998,6 @@
     1.4      _session->messageToSend = messageToSend;
     1.5      _session->inject_sync_event = inject_sync_event;
     1.6  
     1.7 -#ifdef DEBUG_ERRORSTACK
     1.8 -    _session->errorstack = new_stringlist("init()");
     1.9 -#endif
    1.10 -
    1.11      assert(LOCAL_DB);
    1.12      if (LOCAL_DB == NULL) {
    1.13          status = PEP_INIT_CANNOT_OPEN_DB;
    1.14 @@ -2307,10 +2303,6 @@
    1.15  
    1.16          release_transport_system(session, out_last);
    1.17          release_cryptotech(session, out_last);
    1.18 -
    1.19 -#ifdef DEBUG_ERRORSTACK
    1.20 -        free_stringlist(session->errorstack);
    1.21 -#endif
    1.22          free(session);
    1.23      }
    1.24  }
    1.25 @@ -5706,55 +5698,6 @@
    1.26      return PEP_STATUS_OK;
    1.27  }
    1.28  
    1.29 -#ifdef DEBUG_ERRORSTACK
    1.30 -PEP_STATUS session_add_error(PEP_SESSION session, const char* file, unsigned line, PEP_STATUS status)
    1.31 -{
    1.32 -    char logline[48];
    1.33 -    if(status>0)
    1.34 -    {
    1.35 -        snprintf(logline,47, "%.24s:%u status=%u (0x%x)", file, line, status, status);
    1.36 -    }else{
    1.37 -        snprintf(logline,47, "%.24s:%u status=%i.", file, line, status);
    1.38 -    }
    1.39 -    stringlist_add(session->errorstack, logline); // logline is copied! :-)
    1.40 -    return status;
    1.41 -}
    1.42 -
    1.43 -DYNAMIC_API const stringlist_t* get_errorstack(PEP_SESSION session)
    1.44 -{
    1.45 -    return session->errorstack;
    1.46 -}
    1.47 -
    1.48 -DYNAMIC_API void clear_errorstack(PEP_SESSION session)
    1.49 -{
    1.50 -    const int old_len = stringlist_length(session->errorstack);
    1.51 -    char buf[48];
    1.52 -    free_stringlist(session->errorstack);
    1.53 -    snprintf(buf, 47, "(%i elements cleared)", old_len);
    1.54 -    session->errorstack = new_stringlist(buf);
    1.55 -}
    1.56 -
    1.57 -#else
    1.58 -
    1.59 -static stringlist_t* dummy_errorstack = NULL;
    1.60 -
    1.61 -DYNAMIC_API const stringlist_t* get_errorstack(PEP_SESSION session)
    1.62 -{
    1.63 -    if(dummy_errorstack == NULL)
    1.64 -    {
    1.65 -        dummy_errorstack = new_stringlist("( Please recompile pEpEngine with -DDEBUG_ERRORSTACK )");
    1.66 -    }
    1.67 -
    1.68 -    return dummy_errorstack;
    1.69 -}
    1.70 -
    1.71 -DYNAMIC_API void clear_errorstack(PEP_SESSION session)
    1.72 -{
    1.73 -    // nothing to do here
    1.74 -}
    1.75 -
    1.76 -#endif
    1.77 -
    1.78  DYNAMIC_API void _service_error_log(PEP_SESSION session, const char *entity,
    1.79          PEP_STATUS status, const char *where)
    1.80  {
     2.1 --- a/src/pEpEngine.h	Fri Jul 31 00:18:09 2020 +0200
     2.2 +++ b/src/pEpEngine.h	Wed Aug 05 13:09:06 2020 +0200
     2.3 @@ -261,26 +261,6 @@
     2.4  
     2.5  DYNAMIC_API void release(PEP_SESSION session);
     2.6  
     2.7 -
     2.8 -// const stringlist_t* get_errorstack(PEP_SESSION) - get the error stack for that session, if any
     2.9 -//
    2.10 -//  parameters:
    2.11 -//        session (in)    session handle
    2.12 -//
    2.13 -//    caveat:
    2.14 -//        To get a useful error stack you have to compile with -DDEBUG_ERRORSTACK
    2.15 -//        The error stack belongs to the session. Do no not change it!
    2.16 -DYNAMIC_API const stringlist_t* get_errorstack(PEP_SESSION session);
    2.17 -
    2.18 -
    2.19 -// void clear_errorstack(PEP_SESSION) - clear the error stack for that session, if any
    2.20 -//
    2.21 -//  parameters:
    2.22 -//        session (in)    session handle
    2.23 -//
    2.24 -DYNAMIC_API void clear_errorstack(PEP_SESSION session);
    2.25 -
    2.26 -
    2.27  // config_passive_mode() - enable passive mode
    2.28  //
    2.29  //  parameters:
     3.1 --- a/src/pEp_internal.h	Fri Jul 31 00:18:09 2020 +0200
     3.2 +++ b/src/pEp_internal.h	Wed Aug 05 13:09:06 2020 +0200
     3.3 @@ -268,9 +268,6 @@
     3.4      bool service_log;
     3.5      
     3.6  #ifndef NDEBUG
     3.7 -#   ifdef DEBUG_ERRORSTACK
     3.8 -    stringlist_t* errorstack;
     3.9 -#   endif
    3.10      int debug_color;
    3.11  #endif
    3.12  };