ADD_TO_LOG and GOTO are now simply removed everywhere.
authorKrista Bennett <krista@pep-project.org>
Tue, 13 Feb 2018 00:13:18 +0100
changeset 25012e8bb7f39f04
parent 2500 b9e025865715
child 2502 8c29dd55946e
child 2503 6f78d64d39ca
ADD_TO_LOG and GOTO are now simply removed everywhere.
src/keymanagement.c
src/message_api.c
src/pEpEngine.c
src/pEp_internal.h
     1.1 --- a/src/keymanagement.c	Mon Feb 12 23:02:13 2018 +0100
     1.2 +++ b/src/keymanagement.c	Tue Feb 13 00:13:18 2018 +0100
     1.3 @@ -142,7 +142,7 @@
     1.4      status = key_revoked(session, fpr, &revoked);    
     1.5          
     1.6      if (status != PEP_STATUS_OK) {
     1.7 -        return ADD_TO_LOG(status);
     1.8 +        return status;
     1.9      }
    1.10      
    1.11      if (!revoked) {
    1.12 @@ -155,7 +155,7 @@
    1.13                               
    1.14          assert(status == PEP_STATUS_OK);
    1.15          if (status != PEP_STATUS_OK)
    1.16 -            return ADD_TO_LOG(status);
    1.17 +            return status;
    1.18  
    1.19          if ((ct | PEP_ct_confirmed) == PEP_ct_OpenPGP &&
    1.20              !ident->me) {
    1.21 @@ -164,7 +164,7 @@
    1.22                                           &blacklisted);
    1.23                                           
    1.24              if (status != PEP_STATUS_OK)
    1.25 -                return ADD_TO_LOG(status);
    1.26 +                return status;
    1.27          }
    1.28      }
    1.29              
    1.30 @@ -180,7 +180,7 @@
    1.31              status = key_expired(session, fpr, time(NULL), &expired);            
    1.32              if (status != PEP_STATUS_OK) {
    1.33                   ident->comm_type = PEP_ct_key_expired;
    1.34 -                 return ADD_TO_LOG(status);
    1.35 +                 return status;
    1.36               }
    1.37              // communicate key(?)
    1.38          }        
    1.39 @@ -458,7 +458,7 @@
    1.40      assert(!EMPTYSTR(identity->address));
    1.41  
    1.42      if (!(session && identity && !EMPTYSTR(identity->address)))
    1.43 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.44 +        return PEP_ILLEGAL_VALUE;
    1.45  
    1.46      char* default_own_id = NULL;
    1.47      status = get_default_own_userid(session, &default_own_id);    
    1.48 @@ -729,7 +729,7 @@
    1.49          if (session->examine_identity)
    1.50              session->examine_identity(identity, session->examine_management);
    1.51  
    1.52 -    return ADD_TO_LOG(status);
    1.53 +    return status;
    1.54  }
    1.55  
    1.56  PEP_STATUS elect_ownkey(
    1.57 @@ -819,7 +819,7 @@
    1.58      
    1.59      *is_usable = !dont_use_fpr;
    1.60      
    1.61 -    return ADD_TO_LOG(status);
    1.62 +    return status;
    1.63  }
    1.64  
    1.65  PEP_STATUS _myself(PEP_SESSION session, pEp_identity * identity, bool do_keygen, bool ignore_flags)
    1.66 @@ -834,7 +834,7 @@
    1.67  
    1.68      if (!session || !identity || EMPTYSTR(identity->address) ||
    1.69          EMPTYSTR(identity->user_id))
    1.70 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.71 +        return PEP_ILLEGAL_VALUE;
    1.72  
    1.73      pEp_identity *stored_identity = NULL;
    1.74      char* revoked_fpr = NULL; 
    1.75 @@ -871,7 +871,7 @@
    1.76      
    1.77      // Let's see if we have an identity record in the DB for 
    1.78      // this user_id + address
    1.79 -    DEBUG_LOG("myself", "debug", identity->address);
    1.80 +//    DEBUG_LOG("myself", "debug", identity->address);
    1.81   
    1.82      status = get_identity(session,
    1.83                            identity->address,
    1.84 @@ -942,7 +942,7 @@
    1.85          if (!do_keygen)
    1.86              status = PEP_GET_KEY_FAILED;
    1.87          else {
    1.88 -            DEBUG_LOG("Generating key pair", "debug", identity->address);
    1.89 +// /            DEBUG_LOG("Generating key pair", "debug", identity->address);
    1.90  
    1.91              free(identity->fpr);
    1.92              identity->fpr = NULL;
    1.93 @@ -952,7 +952,7 @@
    1.94              if (status != PEP_STATUS_OK) {
    1.95                  char buf[11];
    1.96                  snprintf(buf, 11, "%d", status); // uh, this is kludgey. FIXME
    1.97 -                DEBUG_LOG("Generating key pair failed", "debug", buf);
    1.98 +//                DEBUG_LOG("Generating key pair failed", "debug", buf);
    1.99              }        
   1.100              else {
   1.101                  valid_key_found = true;
   1.102 @@ -980,7 +980,7 @@
   1.103      free(default_own_id);
   1.104      free(revoked_fpr);                     
   1.105      free_identity(stored_identity);
   1.106 -    return ADD_TO_LOG(status);
   1.107 +    return status;
   1.108  }
   1.109  
   1.110  DYNAMIC_API PEP_STATUS initialise_own_identities(PEP_SESSION session,
   1.111 @@ -1011,7 +1011,7 @@
   1.112  
   1.113  DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
   1.114  {
   1.115 -    return ADD_TO_LOG(_myself(session, identity, true, false));
   1.116 +    return _myself(session, identity, true, false);
   1.117  }
   1.118  
   1.119  DYNAMIC_API PEP_STATUS register_examine_function(
     2.1 --- a/src/message_api.c	Mon Feb 12 23:02:13 2018 +0100
     2.2 +++ b/src/message_api.c	Tue Feb 13 00:13:18 2018 +0100
     2.3 @@ -1461,15 +1461,15 @@
     2.4      assert(dst);
     2.5  
     2.6      if (!(session && src && dst))
     2.7 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
     2.8 +        return PEP_ILLEGAL_VALUE;
     2.9  
    2.10      if (src->dir == PEP_dir_incoming)
    2.11 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    2.12 +        return PEP_ILLEGAL_VALUE;
    2.13  
    2.14      determine_encryption_format(src);
    2.15      // TODO: change this for multi-encryption in message format 2.0
    2.16      if (src->enc_format != PEP_enc_none)
    2.17 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    2.18 +        return PEP_ILLEGAL_VALUE;
    2.19  
    2.20      *dst = NULL;
    2.21  
    2.22 @@ -1484,7 +1484,7 @@
    2.23      
    2.24      status = myself(session, src->from);
    2.25      if (status != PEP_STATUS_OK)
    2.26 -        GOTO(pep_error);
    2.27 +        goto pep_error;
    2.28  
    2.29      keys = new_stringlist(src->from->fpr);
    2.30      if (keys == NULL)
    2.31 @@ -1531,7 +1531,7 @@
    2.32              _status = myself(session, _il->ident);
    2.33          if (_status != PEP_STATUS_OK) {
    2.34              status = PEP_UNENCRYPTED;
    2.35 -            GOTO(pep_error);
    2.36 +            goto pep_error;
    2.37          }
    2.38  
    2.39          if (_il->ident->fpr && _il->ident->fpr[0]) {
    2.40 @@ -1563,7 +1563,7 @@
    2.41                  _status = myself(session, _il->ident);
    2.42              if (_status != PEP_STATUS_OK) {
    2.43                  status = PEP_UNENCRYPTED;
    2.44 -                GOTO(pep_error);
    2.45 +                goto pep_error;
    2.46              }
    2.47  
    2.48              if (_il->ident->fpr && _il->ident->fpr[0]) {
    2.49 @@ -1595,7 +1595,7 @@
    2.50              if (_status != PEP_STATUS_OK)
    2.51              {
    2.52                  status = PEP_UNENCRYPTED;
    2.53 -                GOTO(pep_error);
    2.54 +                goto pep_error;
    2.55              }
    2.56  
    2.57              if (_il->ident->fpr && _il->ident->fpr[0]) {
    2.58 @@ -1622,7 +1622,7 @@
    2.59              attach_own_key(session, src);
    2.60              decorate_message(src, PEP_rating_undefined, NULL, true);
    2.61          }
    2.62 -        return ADD_TO_LOG(PEP_UNENCRYPTED);
    2.63 +        return PEP_UNENCRYPTED;
    2.64      }
    2.65      else {
    2.66          // FIXME - we need to deal with transport types (via flag)
    2.67 @@ -1663,14 +1663,14 @@
    2.68              default:
    2.69                  assert(0);
    2.70                  status = PEP_ILLEGAL_VALUE;
    2.71 -                GOTO(pep_error);
    2.72 +                goto pep_error;
    2.73          }
    2.74  
    2.75          if (status == PEP_OUT_OF_MEMORY)
    2.76              goto enomem;
    2.77  
    2.78          if (status != PEP_STATUS_OK)
    2.79 -            GOTO(pep_error);
    2.80 +            goto pep_error;
    2.81      }
    2.82  
    2.83      free_stringlist(keys);
    2.84 @@ -1699,7 +1699,7 @@
    2.85      if (_src && _src != src)
    2.86          free_message(_src);
    2.87          
    2.88 -    return ADD_TO_LOG(status);
    2.89 +    return status;
    2.90  
    2.91  enomem:
    2.92      status = PEP_OUT_OF_MEMORY;
    2.93 @@ -1710,7 +1710,7 @@
    2.94      if (_src && _src != src)
    2.95          free_message(_src);
    2.96  
    2.97 -    return ADD_TO_LOG(status);
    2.98 +    return status;
    2.99  }
   2.100  
   2.101  DYNAMIC_API PEP_STATUS encrypt_message_for_self(
   2.102 @@ -1733,14 +1733,14 @@
   2.103      assert(enc_format != PEP_enc_none);
   2.104  
   2.105      if (!(session && src && dst && enc_format != PEP_enc_none))
   2.106 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.107 +        return PEP_ILLEGAL_VALUE;
   2.108  
   2.109      if (src->dir == PEP_dir_incoming)
   2.110 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.111 +        return PEP_ILLEGAL_VALUE;
   2.112  
   2.113      determine_encryption_format(src);
   2.114      if (src->enc_format != PEP_enc_none)
   2.115 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.116 +        return PEP_ILLEGAL_VALUE;
   2.117  
   2.118      if (target_id && (!target_id->user_id || target_id->user_id[0] == '\0')) {
   2.119          char* own_id = NULL;
   2.120 @@ -1753,7 +1753,7 @@
   2.121  
   2.122      status = myself(session, target_id);
   2.123      if (status != PEP_STATUS_OK)
   2.124 -        GOTO(pep_error);
   2.125 +        goto pep_error;
   2.126  
   2.127      *dst = NULL;
   2.128  
   2.129 @@ -1831,7 +1831,7 @@
   2.130      if (src != _src)
   2.131          free_message(_src);
   2.132  
   2.133 -    return ADD_TO_LOG(status);
   2.134 +    return status;
   2.135  }
   2.136  
   2.137  // static PEP_STATUS _update_identity_for_incoming_message(
   2.138 @@ -2508,7 +2508,7 @@
   2.139      assert(flags);
   2.140  
   2.141      if (!(session && src && dst && keylist && rating && flags))
   2.142 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.143 +        return PEP_ILLEGAL_VALUE;
   2.144  
   2.145      /*** Begin init ***/
   2.146      PEP_STATUS status = PEP_STATUS_OK;
   2.147 @@ -2569,7 +2569,7 @@
   2.148          status = myself(session, src->from);
   2.149          
   2.150      if (status != PEP_STATUS_OK)
   2.151 -        return ADD_TO_LOG(status);
   2.152 +        return status;
   2.153      
   2.154      /*** End Import any attached public keys and update identities accordingly ***/
   2.155      
   2.156 @@ -2598,7 +2598,7 @@
   2.157                                      
   2.158          pull_up_attached_main_msg(src);
   2.159          
   2.160 -        return ADD_TO_LOG(PEP_UNENCRYPTED);
   2.161 +        return PEP_UNENCRYPTED;
   2.162      }
   2.163  
   2.164      status = get_crypto_text(src, &ctext, &csize);
   2.165 @@ -2611,7 +2611,7 @@
   2.166                                                     &ptext, &psize, &_keylist);
   2.167  
   2.168      if (status > PEP_CANNOT_DECRYPT_UNKNOWN)
   2.169 -        GOTO(pep_error);
   2.170 +        goto pep_error;
   2.171  
   2.172      decrypt_status = status;
   2.173      
   2.174 @@ -2644,7 +2644,7 @@
   2.175                                                               &imported_private_key_address,
   2.176                                                               private_il);
   2.177                  if (status != PEP_STATUS_OK)
   2.178 -                    GOTO(pep_error);            
   2.179 +                    goto pep_error;            
   2.180  
   2.181                  /* if decrypted, but not verified... */
   2.182                  if (decrypt_status == PEP_DECRYPTED) {
   2.183 @@ -2705,7 +2705,7 @@
   2.184                                                               actual_message->size, 
   2.185                                                               &inner_message);
   2.186                                  if (status != PEP_STATUS_OK)
   2.187 -                                    GOTO(pep_error);
   2.188 +                                    goto pep_error;
   2.189                                  
   2.190                                  if (inner_message) {
   2.191                                      // Though this will strip any message info on the
   2.192 @@ -2722,7 +2722,7 @@
   2.193                                          if (strcmp(wrap_info, "INNER") == 0) {
   2.194                                              if (status != PEP_STATUS_OK) {
   2.195                                                  free_message(inner_message);
   2.196 -                                                GOTO(pep_error);
   2.197 +                                                goto pep_error;
   2.198                                              }
   2.199                                                  
   2.200                                              // THIS is our message
   2.201 @@ -2740,7 +2740,7 @@
   2.202                                          else { // should never happen
   2.203                                              status = PEP_UNKNOWN_ERROR;
   2.204                                              free_message(inner_message);
   2.205 -                                            GOTO(pep_error);
   2.206 +                                            goto pep_error;
   2.207                                          }
   2.208                                      }
   2.209                                      inner_message->enc_format = PEP_enc_none;
   2.210 @@ -2775,7 +2775,7 @@
   2.211                   rating, src->from, _keylist);
   2.212  
   2.213          if (status != PEP_STATUS_OK)
   2.214 -            GOTO(pep_error);
   2.215 +            goto pep_error;
   2.216          
   2.217          /* We decrypted ok, hallelujah. */
   2.218          msg->enc_format = PEP_enc_none;    
   2.219 @@ -2822,9 +2822,9 @@
   2.220      *keylist = _keylist;
   2.221  
   2.222      if(decrypt_status == PEP_DECRYPTED_AND_VERIFIED)
   2.223 -        return ADD_TO_LOG(PEP_STATUS_OK);
   2.224 +        return PEP_STATUS_OK;
   2.225      else
   2.226 -        return ADD_TO_LOG(decrypt_status);
   2.227 +        return decrypt_status;
   2.228  
   2.229  enomem:
   2.230      status = PEP_OUT_OF_MEMORY;
   2.231 @@ -2835,7 +2835,7 @@
   2.232      free_message(msg);
   2.233      free_stringlist(_keylist);
   2.234  
   2.235 -    return ADD_TO_LOG(status);
   2.236 +    return status;
   2.237  }
   2.238  
   2.239  DYNAMIC_API PEP_STATUS decrypt_message(
   2.240 @@ -2884,7 +2884,7 @@
   2.241  
   2.242      free_identity_list(private_il);
   2.243  
   2.244 -    return ADD_TO_LOG(status);
   2.245 +    return status;
   2.246  }
   2.247  
   2.248  // Note: if comm_type_determine is false, it generally means that
   2.249 @@ -2941,10 +2941,10 @@
   2.250      assert(rating);
   2.251  
   2.252      if (!(session && msg && rating))
   2.253 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.254 +        return PEP_ILLEGAL_VALUE;
   2.255  
   2.256      if (msg->dir != PEP_dir_outgoing)
   2.257 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.258 +        return PEP_ILLEGAL_VALUE;
   2.259  
   2.260      *rating = PEP_rating_undefined;
   2.261  
   2.262 @@ -3222,7 +3222,7 @@
   2.263          free (XORed_fpr);
   2.264          
   2.265      the_end:
   2.266 -    return ADD_TO_LOG(status);
   2.267 +    return status;
   2.268  }
   2.269  
   2.270  DYNAMIC_API PEP_STATUS get_message_trustwords(
   2.271 @@ -3308,7 +3308,7 @@
   2.272  
   2.273      if (status != PEP_STATUS_OK) {
   2.274          free_identity(partner);
   2.275 -        return ADD_TO_LOG(status);
   2.276 +        return status;
   2.277      }
   2.278     
   2.279      // Find own identity corresponding to given account address.
   2.280 @@ -3321,7 +3321,7 @@
   2.281  
   2.282      if (status != PEP_STATUS_OK) {
   2.283          free_identity(stored_identity);
   2.284 -        return ADD_TO_LOG(status);
   2.285 +        return status;
   2.286      }
   2.287  
   2.288      // get the trustwords
   2.289 @@ -3330,7 +3330,7 @@
   2.290                              partner, received_by, 
   2.291                              lang, words, &wsize, full);
   2.292  
   2.293 -    return ADD_TO_LOG(status);
   2.294 +    return status;
   2.295  }
   2.296  
   2.297  DYNAMIC_API PEP_STATUS MIME_decrypt_message(
   2.298 @@ -3356,7 +3356,7 @@
   2.299  
   2.300      status = mime_decode_message(mimetext, size, &tmp_msg);
   2.301      if (status != PEP_STATUS_OK)
   2.302 -        GOTO(pep_error);
   2.303 +        goto pep_error;
   2.304  
   2.305      // MIME decode message delivers only addresses. We need more.
   2.306      if (tmp_msg->from) {
   2.307 @@ -3366,20 +3366,20 @@
   2.308              status = myself(session, tmp_msg->from);
   2.309  
   2.310          if (status == PEP_ILLEGAL_VALUE || status == PEP_OUT_OF_MEMORY)
   2.311 -            GOTO(pep_error);
   2.312 +            goto pep_error;
   2.313      }
   2.314  
   2.315      status = update_identity_recip_list(session, tmp_msg->to);
   2.316      if (status != PEP_STATUS_OK)
   2.317 -        GOTO(pep_error);
   2.318 +        goto pep_error;
   2.319  
   2.320      status = update_identity_recip_list(session, tmp_msg->cc);
   2.321      if (status != PEP_STATUS_OK)
   2.322 -        GOTO(pep_error);
   2.323 +        goto pep_error;
   2.324  
   2.325      status = update_identity_recip_list(session, tmp_msg->bcc);
   2.326      if (status != PEP_STATUS_OK)
   2.327 -        GOTO(pep_error);
   2.328 +        goto pep_error;
   2.329  
   2.330      PEP_STATUS decrypt_status = decrypt_message(session,
   2.331                                                  tmp_msg,
   2.332 @@ -3395,7 +3395,7 @@
   2.333      if (decrypt_status > PEP_CANNOT_DECRYPT_UNKNOWN || !dec_msg)
   2.334      {
   2.335          status = decrypt_status;
   2.336 -        GOTO(pep_error);
   2.337 +        goto pep_error;
   2.338      }
   2.339  
   2.340      // FIXME: test with att
   2.341 @@ -3405,14 +3405,14 @@
   2.342      {
   2.343          free(tmp_msg);
   2.344          free(dec_msg);
   2.345 -        return ADD_TO_LOG(decrypt_status);
   2.346 +        return decrypt_status;
   2.347      }
   2.348      
   2.349  pep_error:
   2.350      free_message(tmp_msg);
   2.351      free_message(dec_msg);
   2.352  
   2.353 -    return ADD_TO_LOG(status);
   2.354 +    return status;
   2.355  }
   2.356  
   2.357  
   2.358 @@ -3432,7 +3432,7 @@
   2.359  
   2.360      status = mime_decode_message(mimetext, size, &tmp_msg);
   2.361      if (status != PEP_STATUS_OK)
   2.362 -        GOTO(pep_error);
   2.363 +        goto pep_error;
   2.364  
   2.365      // MIME decode message delivers only addresses. We need more.
   2.366      if (tmp_msg->from) {
   2.367 @@ -3449,7 +3449,7 @@
   2.368              
   2.369          status = myself(session, tmp_msg->from);
   2.370          if (status != PEP_STATUS_OK)
   2.371 -            GOTO(pep_error);
   2.372 +            goto pep_error;
   2.373      }
   2.374      
   2.375      // Own identities can be retrieved here where they would otherwise
   2.376 @@ -3457,15 +3457,15 @@
   2.377      // desired. FIXME: IS it?
   2.378      status = update_identity_recip_list(session, tmp_msg->to);
   2.379      if (status != PEP_STATUS_OK)
   2.380 -        GOTO(pep_error);
   2.381 +        goto pep_error;
   2.382      
   2.383      status = update_identity_recip_list(session, tmp_msg->cc);
   2.384      if (status != PEP_STATUS_OK)
   2.385 -        GOTO(pep_error);
   2.386 +        goto pep_error;
   2.387      
   2.388      status = update_identity_recip_list(session, tmp_msg->bcc);
   2.389      if (status != PEP_STATUS_OK)
   2.390 -        GOTO(pep_error);
   2.391 +        goto pep_error;
   2.392      
   2.393      // This isn't incoming, though... so we need to reverse the direction
   2.394      tmp_msg->dir = PEP_dir_outgoing;
   2.395 @@ -3476,12 +3476,12 @@
   2.396                               enc_format,
   2.397                               flags);
   2.398      if (status != PEP_STATUS_OK)
   2.399 -        GOTO(pep_error);
   2.400 +        goto pep_error;
   2.401  
   2.402  
   2.403      if (!enc_msg) {
   2.404          status = PEP_UNKNOWN_ERROR;
   2.405 -        GOTO(pep_error);
   2.406 +        goto pep_error;
   2.407      }
   2.408  
   2.409      status = _mime_encode_message_internal(enc_msg, false, mime_ciphertext, false);
   2.410 @@ -3490,7 +3490,7 @@
   2.411      free_message(tmp_msg);
   2.412      free_message(enc_msg);
   2.413  
   2.414 -    return ADD_TO_LOG(status);
   2.415 +    return status;
   2.416  
   2.417  }
   2.418  
   2.419 @@ -3534,7 +3534,7 @@
   2.420      free_message(tmp_msg);
   2.421      free_message(enc_msg);
   2.422  
   2.423 -    return ADD_TO_LOG(status);
   2.424 +    return status;
   2.425  }
   2.426  
   2.427  static PEP_rating string_to_rating(const char * rating)
   2.428 @@ -3627,7 +3627,7 @@
   2.429      assert(rating);
   2.430  
   2.431      if (!(session && msg && rating))
   2.432 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.433 +        return PEP_ILLEGAL_VALUE;
   2.434  
   2.435      *rating = PEP_rating_undefined;
   2.436  
   2.437 @@ -3638,7 +3638,7 @@
   2.438                  goto got_rating;
   2.439              }
   2.440          }
   2.441 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.442 +        return PEP_ILLEGAL_VALUE;
   2.443      }
   2.444  
   2.445  got_rating:
   2.446 @@ -3650,7 +3650,7 @@
   2.447              if (strcasecmp(i->value->key, "X-KeyList") == 0){
   2.448                  status = string_to_keylist(i->value->value, &_keylist);
   2.449                  if (status != PEP_STATUS_OK)
   2.450 -                    GOTO(pep_error);
   2.451 +                    goto pep_error;
   2.452                  must_free_keylist = true;
   2.453                  goto got_keylist;
   2.454              }
   2.455 @@ -3659,10 +3659,10 @@
   2.456          // there was no rcpt fpr, it could be an unencrypted mail
   2.457          if(_rating == PEP_rating_unencrypted) {
   2.458              *rating = _rating;
   2.459 -            return ADD_TO_LOG(PEP_STATUS_OK);
   2.460 +            return PEP_STATUS_OK;
   2.461          }
   2.462  
   2.463 -        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   2.464 +        return PEP_ILLEGAL_VALUE;
   2.465      }
   2.466  got_keylist:
   2.467  
   2.468 @@ -3672,7 +3672,7 @@
   2.469          status = myself(session, msg->from);
   2.470  
   2.471      if (status != PEP_STATUS_OK)
   2.472 -        GOTO(pep_error);
   2.473 +        goto pep_error;
   2.474  
   2.475      status = amend_rating_according_to_sender_and_recipients(session, &_rating,
   2.476              msg->from, _keylist);
   2.477 @@ -3683,5 +3683,5 @@
   2.478      if (must_free_keylist)
   2.479          free_stringlist(_keylist);
   2.480  
   2.481 -    return ADD_TO_LOG(status);
   2.482 +    return status;
   2.483  }
     3.1 --- a/src/pEpEngine.c	Mon Feb 12 23:02:13 2018 +0100
     3.2 +++ b/src/pEpEngine.c	Tue Feb 13 00:13:18 2018 +0100
     3.3 @@ -3356,7 +3356,7 @@
     3.4      status = PEP_OUT_OF_MEMORY;
     3.5  
     3.6  the_end:
     3.7 -    return ADD_TO_LOG(status);
     3.8 +    return status;
     3.9  }
    3.10  
    3.11  DYNAMIC_API PEP_STATUS get_languagelist(
     4.1 --- a/src/pEp_internal.h	Mon Feb 12 23:02:13 2018 +0100
     4.2 +++ b/src/pEp_internal.h	Tue Feb 13 00:13:18 2018 +0100
     4.3 @@ -425,12 +425,3 @@
     4.4      _pEp_rand_max_bits = ceil(log2(RAND_MAX));
     4.5      _pEp_log2_36 = log2(36);
     4.6  }
     4.7 -
     4.8 -#ifdef DEBUG_ERRORSTACK
     4.9 -    PEP_STATUS session_add_error(PEP_SESSION session, const char* file, unsigned line, PEP_STATUS status);
    4.10 -    #define ADD_TO_LOG(status)   session_add_error(session, __FILE__, __LINE__, (status))
    4.11 -    #define GOTO(label)          do{ (void)session_add_error(session, __FILE__, __LINE__, status); goto label; }while(0)
    4.12 -#else
    4.13 -    #define ADD_TO_LOG(status)   (status)
    4.14 -    #define GOTO(label)          goto label
    4.15 -#endif