IOSAD-124 comments locks that are assumed needless. The actual issue is caused by locking in PEPSync though. IOSAD-124
authorbuff <andreas@pep-project.org>
Fri, 19 Jul 2019 22:22:17 +0200
branchIOSAD-124
changeset 10716be15a91521c
parent 1070 eed06a1066fe
child 1072 a5b4592a4748
IOSAD-124 comments locks that are assumed needless. The actual issue is caused by locking in PEPSync though.
pEpObjCAdapter/PEPInternalSession.m
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Fri Jul 19 22:15:38 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Fri Jul 19 22:22:17 2019 +0200
     1.3 @@ -133,14 +133,14 @@
     1.4  
     1.5      PEPRating internalRating = PEPRatingUndefined;
     1.6  
     1.7 -    [self lockWrite];
     1.8 +    //[self lockWrite];
     1.9      PEPStatus theStatus = (PEPStatus) decrypt_message(_session,
    1.10                                                        _src,
    1.11                                                        &_dst,
    1.12                                                        &theKeys,
    1.13                                                        (PEP_rating *) &internalRating,
    1.14                                                        (PEP_decrypt_flags *) &theFlags);
    1.15 -    [self unlockWrite];
    1.16 +    //[self unlockWrite];
    1.17  
    1.18      if (status) {
    1.19          *status = theStatus;
    1.20 @@ -217,13 +217,13 @@
    1.21          theKeys = PEP_arrayToStringlist(xKeyList);
    1.22      }
    1.23  
    1.24 -    [self lockWrite];
    1.25 +    //[self lockWrite];
    1.26      PEPStatus theStatus = (PEPStatus) re_evaluate_message_rating(_session,
    1.27                                                                   _src,
    1.28                                                                   theKeys,
    1.29                                                                   (PEP_rating) *rating,
    1.30                                                                   (PEP_rating *) rating);
    1.31 -    [self unlockWrite];
    1.32 +    //[self unlockWrite];
    1.33  
    1.34      free_message(_src);
    1.35      free_stringlist(theKeys);
    1.36 @@ -361,7 +361,7 @@
    1.37  
    1.38      stringlist_t *keysStringList = PEP_arrayToStringlist(extraKeys);
    1.39  
    1.40 -    [self lockWrite];
    1.41 +    //[self lockWrite];
    1.42      PEPStatus theStatus = (PEPStatus) encrypt_message_for_self(_session,
    1.43                                                                 ident,
    1.44                                                                 _src,
    1.45 @@ -369,7 +369,7 @@
    1.46                                                                 &_dst,
    1.47                                                                 PEP_enc_PGP_MIME,
    1.48                                                                 flags);
    1.49 -    [self unlockWrite];
    1.50 +    //[self unlockWrite];
    1.51  
    1.52      free_stringlist(keysStringList);
    1.53  
    1.54 @@ -430,12 +430,12 @@
    1.55      message *src = PEP_messageDictToStruct([self removeEmptyRecipients:messageDict]);
    1.56      message *dst = NULL;
    1.57  
    1.58 -    [self lockWrite];
    1.59 +    //[self lockWrite];
    1.60      PEPStatus theStatus = (PEPStatus)
    1.61      encrypt_message_and_add_priv_key(_session, src, &dst,
    1.62                                       [[toFpr precomposedStringWithCanonicalMapping] UTF8String],
    1.63                                       (PEP_enc_format) encFormat, flags);
    1.64 -    [self unlockWrite];
    1.65 +    //[self unlockWrite];
    1.66  
    1.67      if (status) {
    1.68          *status = theStatus;
    1.69 @@ -485,11 +485,11 @@
    1.70      message *_msg = PEP_messageToStruct(theMessage);
    1.71      PEPRating rating = PEPRatingUndefined;
    1.72  
    1.73 -    [self lockWrite];
    1.74 +    //[self lockWrite];
    1.75      PEPStatus status = (PEPStatus) outgoing_message_rating(_session,
    1.76                                                             _msg,
    1.77                                                             (PEP_rating *) &rating);
    1.78 -    [self unlockWrite];
    1.79 +    //[self unlockWrite];
    1.80  
    1.81      free_message(_msg);
    1.82  
    1.83 @@ -524,9 +524,9 @@
    1.84      pEp_identity *ident = PEP_identityToStruct(identity);
    1.85      PEPRating rating = PEPRatingUndefined;
    1.86  
    1.87 -    [self lockWrite];
    1.88 +    //[self lockWrite];
    1.89      PEPStatus status = (PEPStatus) identity_rating(_session, ident, (PEP_rating *) &rating);
    1.90 -    [self unlockWrite];
    1.91 +    //[self unlockWrite];
    1.92  
    1.93      free_identity(ident);
    1.94  
    1.95 @@ -577,9 +577,9 @@
    1.96  {
    1.97      pEp_identity *ident = PEP_identityToStruct(identity);
    1.98  
    1.99 -    [self lockWrite];
   1.100 +    //[self lockWrite];
   1.101      PEPStatus status = (PEPStatus) myself(_session, ident);
   1.102 -    [self unlockWrite];
   1.103 +    //[self unlockWrite];
   1.104  
   1.105      if ([NSError setError:error fromPEPStatus:status]) {
   1.106          free_identity(ident);
   1.107 @@ -600,9 +600,9 @@
   1.108      } else {
   1.109          pEp_identity *ident = PEP_identityToStruct(identity);
   1.110  
   1.111 -        [self lockWrite];
   1.112 +        //[self lockWrite];
   1.113          PEPStatus status = (PEPStatus) update_identity(_session, ident);
   1.114 -        [self unlockWrite];
   1.115 +        //[self unlockWrite];
   1.116  
   1.117          if ([NSError setError:error fromPEPStatus:status]) {
   1.118              free_identity(ident);
   1.119 @@ -622,9 +622,9 @@
   1.120  {
   1.121      pEp_identity *ident = PEP_identityToStruct(identity);
   1.122  
   1.123 -    [self lockWrite];
   1.124 +    //[self lockWrite];
   1.125      PEPStatus status = (PEPStatus) trust_personal_key(_session, ident);
   1.126 -    [self unlockWrite];
   1.127 +    //[self unlockWrite];
   1.128  
   1.129      if ([NSError setError:error fromPEPStatus:status]) {
   1.130          free_identity(ident);
   1.131 @@ -641,9 +641,9 @@
   1.132  {
   1.133      pEp_identity *ident = PEP_identityToStruct(identity);
   1.134  
   1.135 -    [self lockWrite];
   1.136 +    //[self lockWrite];
   1.137      PEPStatus status = (PEPStatus) key_mistrusted(_session, ident);
   1.138 -    [self unlockWrite];
   1.139 +    //[self unlockWrite];
   1.140  
   1.141      if ([NSError setError:error fromPEPStatus:status]) {
   1.142          free_identity(ident);
   1.143 @@ -662,9 +662,9 @@
   1.144  {
   1.145      pEp_identity *ident = PEP_identityToStruct(identity);
   1.146  
   1.147 -    [self lockWrite];
   1.148 +    //[self lockWrite];
   1.149      PEPStatus status = (PEPStatus) key_reset_trust(_session, ident);
   1.150 -    [self unlockWrite];
   1.151 +    //[self unlockWrite];
   1.152  
   1.153      if ([NSError setError:error fromPEPStatus:status]) {
   1.154          free_identity(ident);
   1.155 @@ -683,11 +683,11 @@
   1.156  {
   1.157      identity_list *identList = NULL;
   1.158  
   1.159 -    [self lockWrite];
   1.160 +    //[self lockWrite];
   1.161      PEPStatus status = (PEPStatus) import_key(_session,
   1.162                                     [[keydata precomposedStringWithCanonicalMapping] UTF8String],
   1.163                                     [keydata length], &identList);
   1.164 -    [self unlockWrite];
   1.165 +    //[self unlockWrite];
   1.166  
   1.167      if ([NSError setError:error fromPEPStatus:status]) {
   1.168          free(identList);
   1.169 @@ -706,7 +706,7 @@
   1.170           comment:(NSString * _Nullable)comment
   1.171             error:(NSError * _Nullable * _Nullable)error
   1.172  {
   1.173 -    [self lockWrite];
   1.174 +    //[self lockWrite];
   1.175      PEPStatus status = (PEPStatus) log_event(_session,
   1.176                                               [[title precomposedStringWithCanonicalMapping]
   1.177                                                UTF8String],
   1.178 @@ -716,7 +716,7 @@
   1.179                                                UTF8String],
   1.180                                               [[comment precomposedStringWithCanonicalMapping]
   1.181                                                UTF8String]);
   1.182 -    [self unlockWrite];
   1.183 +    //[self unlockWrite];
   1.184  
   1.185      if ([NSError setError:error fromPEPStatus:status]) {
   1.186          return NO;
   1.187 @@ -755,12 +755,12 @@
   1.188      PEPAutoPointer *trustwords = [PEPAutoPointer new];
   1.189      size_t sizeWritten = 0;
   1.190  
   1.191 -    [self lockWrite];
   1.192 +    //[self lockWrite];
   1.193      status = (PEPStatus) get_trustwords(_session, ident1, ident2,
   1.194                                          [[language precomposedStringWithCanonicalMapping]
   1.195                                           UTF8String],
   1.196                                          trustwords.charPointerPointer, &sizeWritten, full);
   1.197 -    [self unlockWrite];
   1.198 +    //[self unlockWrite];
   1.199  
   1.200      free_identity(ident1);
   1.201      free_identity(ident2);
   1.202 @@ -788,12 +788,12 @@
   1.203      PEPAutoPointer *trustwords = [PEPAutoPointer new];
   1.204      size_t sizeWritten = 0;
   1.205      
   1.206 -    [self lockWrite];
   1.207 +    //[self lockWrite];
   1.208      status = (PEPStatus) get_trustwords_for_fprs(_session, _fpr1, _fpr2,
   1.209                                          [[language precomposedStringWithCanonicalMapping]
   1.210                                           UTF8String],
   1.211                                          trustwords.charPointerPointer, &sizeWritten, full);
   1.212 -    [self unlockWrite];
   1.213 +    //[self unlockWrite];
   1.214      
   1.215      NSString *result = nil;
   1.216