Browse Source

merge in JNI-111 : wrap remaining functions with cache.api()

pull/2/head Release_2.1.0-RC7
heck 5 years ago
parent
commit
ec98717182
  1. 24
      src/basic_api.cc
  2. 20
      src/pEp.yml2

24
src/basic_api.cc

@ -463,17 +463,17 @@ JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getMachineD
return from_string(env, ::per_machine_directory()); return from_string(env, ::per_machine_directory());
} }
void logPassphraseCache() { //void logPassphraseCache() {
try { // try {
while(true) { //// while(true) {
pEpLog("Cache: '" << cache.latest_passphrase() << "'"); // pEpLog("Cache: '" << cache.latest_passphrase() << "'");
} //// }
} catch(pEp::PassphraseCache::Empty e) { // } catch(pEp::PassphraseCache::Empty e) {
pEpLog(e.what()); // pEpLog(e.what());
} catch(pEp::PassphraseCache::Exhausted ex) { // } catch(pEp::PassphraseCache::Exhausted ex) {
pEpLog(ex.what()); // pEpLog(ex.what());
} // }
} //}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphrase JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphrase
(JNIEnv * env, (JNIEnv * env,
@ -488,7 +488,6 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphras
} }
std::lock_guard<std::mutex> l(*mutex_local); std::lock_guard<std::mutex> l(*mutex_local);
logPassphraseCache();
char *_passphrase = to_string(env, passphrase); char *_passphrase = to_string(env, passphrase);
PEP_STATUS status = ::config_passphrase(session(),cache.add(_passphrase)); PEP_STATUS status = ::config_passphrase(session(),cache.add(_passphrase));
@ -496,7 +495,6 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphras
throw_pEp_Exception(env, status); throw_pEp_Exception(env, status);
return; return;
} }
logPassphraseCache();
} }
} // extern "C" } // extern "C"

20
src/pEp.yml2

@ -191,7 +191,7 @@ namespace pEp {
in bool full in bool full
); );
method get_message_trustwords( method cached=true get_message_trustwords(
in message msg, in message msg,
in stringlist keylist, in stringlist keylist,
in identity receivedby, in identity receivedby,
@ -210,27 +210,17 @@ namespace pEp {
in identity ident in identity ident
); );
// old key_reset function needs to be replaced method cached=true key_reset_identity(
/*
method key_reset(
in string fpr,
in identity ident
);
*/
// new key reset API
method key_reset_identity(
in identity ident, in identity ident,
in string fpr in string fpr
); );
method key_reset_user( method cached=true key_reset_user(
in string userid, in string userid,
in string fpr in string fpr
); );
method key_reset_all_own_keys(); method cached=true key_reset_all_own_keys();
method deliverHandshakeResult( method deliverHandshakeResult(
in SyncHandshakeResult shr, in SyncHandshakeResult shr,
@ -243,7 +233,7 @@ namespace pEp {
in identity ident in identity ident
); );
method disable_identity_for_sync( method cached=true disable_identity_for_sync(
in identity ident in identity ident
); );

Loading…
Cancel
Save