Browse Source

formatting and code style only

remotes/origin/master Release_2.2.0-RC1
heck 2 years ago
parent
commit
a255490628
10 changed files with 1157 additions and 1151 deletions
  1. +8
    -14
      src/codegen/gen_cpp_Engine.ysl2
  2. +38
    -25
      src/codegen/gen_cpp_Message.ysl2
  3. +57
    -104
      src/cxx/basic_api.cc
  4. +82
    -86
      src/cxx/foundation_pEp_jniadapter_AbstractEngine.cc
  5. +25
    -20
      src/cxx/foundation_pEp_jniadapter__Blob.cc
  6. +4
    -2
      src/cxx/identity_api.cc
  7. +780
    -755
      src/cxx/jniutils.cc
  8. +124
    -107
      src/cxx/jniutils.hh
  9. +5
    -4
      src/cxx/passphrase_callback.hh
  10. +34
    -34
      src/cxx/passphrase_callback.hxx

+ 8
- 14
src/codegen/gen_cpp_Engine.ysl2 View File

@ -51,10 +51,8 @@ tstylesheet {
}
||
JNIEXPORT «$CretType» JNICALL «$mangled»(
JNIEnv *env,
jobject obj`apply "parm[in|inout]", mode=sig`
)
JNIEXPORT «$CretType» JNICALL «$mangled»(JNIEnv *env,
jobject obj`apply "parm[in|inout]", mode=sig`)
{
std::mutex *mutex_local = nullptr;
{
@ -83,13 +81,11 @@ tstylesheet {
}
}
||
if ((status > PEP_STATUS_OK && status < PEP_UNENCRYPTED) |`> |`
status < PEP_STATUS_OK |`> |`
status >= PEP_TRUSTWORD_NOT_FOUND) {
if ((status > PEP_STATUS_OK && status < PEP_UNENCRYPTED) |`> |` status < PEP_STATUS_OK |`> |` status >= PEP_TRUSTWORD_NOT_FOUND) {
throw_pEp_Exception(env, status);
return «$CretDefault»;
}
||
apply "parm[returns|creates]", mode=return;
@ -188,9 +184,9 @@ tstylesheet {
}
||
«$jnitype» «$name»_ = NULL;
if (_«$name»)
if (_«$name») {
«$name»_ = «$from_type»(env, _«$name»);
}
||
}
when "ancestor::namespace/child::enum[@name=$type]" {
@ -200,14 +196,12 @@ tstylesheet {
{
jclass clazz_«$ljtype» = findClass(env, "foundation/pEp/jniadapter/«$jtype»");
assert(clazz_«$ljtype»);
jmethodID method_values = env->GetStaticMethodID(clazz_«$ljtype», "values",
"()[Lfoundation/pEp/jniadapter/«$jtype»;");
jmethodID method_values = env->GetStaticMethodID(clazz_«$ljtype», "values", "()[Lfoundation/pEp/jniadapter/«$jtype»;");
assert(method_values);
jfieldID field_value = env->GetFieldID(clazz_«$ljtype», "value", "I");
assert(field_value);
jobjectArray values = static_cast<jobjectArray>(env->CallStaticObjectMethod(clazz_«$ljtype»,
method_values));
jobjectArray values = static_cast<jobjectArray>(env->CallStaticObjectMethod(clazz_«$ljtype», method_values));
assert(values);
if (env->ExceptionCheck()) {
return nullptr; // handle exception in Java


+ 38
- 25
src/codegen/gen_cpp_Message.ysl2 View File

@ -25,28 +25,28 @@ tstylesheet {
using namespace std;
namespace pEp {
namespace JNIAdapter {
static ::«@name» *«@name»_ptr(JNIEnv *env, jobject me) {
jfieldID handle;
try {
handle = getFieldID(env, "foundation/pEp/jniadapter/«$jname»", "handle", "J");
}
catch (std::exception& ex) {
assert(0);
return NULL;
}
namespace JNIAdapter {
static ::«@name» *«@name»_ptr(JNIEnv *env, jobject me) {
jfieldID handle;
try {
handle = getFieldID(env, "foundation/pEp/jniadapter/«$jname»", "handle", "J");
} catch (std::exception& ex) {
assert(0);
return NULL;
}
return reinterpret_cast<::«@name» *>(env->GetLongField(me, handle));
}
return reinterpret_cast<::«@name» *>(env->GetLongField(me, handle));
}
};
};
};
extern "C" {
using namespace pEp::JNIAdapter;
JNIEXPORT jlong JNICALL Java_foundation_pEp_jniadapter_«$jname»_init(JNIEnv *env, jobject obj)
JNIEXPORT jlong JNICALL Java_foundation_pEp_jniadapter_«$jname»_init(JNIEnv *env,
jobject obj)
{
pEpLog("called");
::«@name» * _obj = ::new_«@name»(PEP_dir_incoming);
@ -57,7 +57,9 @@ tstylesheet {
return reinterpret_cast<jlong>(_obj);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_«$jname»_release(JNIEnv *env, jobject obj, jlong value)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_«$jname»_release(JNIEnv *env,
jobject obj,
jlong value)
{
pEpLog("called");
if (value) {
@ -66,7 +68,9 @@ tstylesheet {
}
}
JNIEXPORT jlong JNICALL Java_foundation_pEp_jniadapter_«$jname»__1«$jname»(JNIEnv *env, jobject msg, jbyteArray mime_text)
JNIEXPORT jlong JNICALL Java_foundation_pEp_jniadapter_«$jname»__1«$jname»(JNIEnv *env,
jobject msg,
jbyteArray mime_text)
{
pEpLog("called");
char *_mime_text = to_string(env, mime_text);
@ -74,21 +78,26 @@ tstylesheet {
::«@name» *_msg = nullptr;
PEP_STATUS status = mime_decode_«@name»(_mime_text, _size, &_msg, NULL);
if (status)
if (status) {
throw_pEp_Exception(env, status);
}
return reinterpret_cast<jlong>(_msg);
}
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_«$jname»__1encodeMIME(JNIEnv *env, jobject msg)
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_«$jname»__1encodeMIME(JNIEnv *env,
jobject msg)
{
pEpLog("called");
«@name» *_obj = «@name»_ptr(env, msg);
char *mime_text = nullptr;
PEP_STATUS status = ::mime_encode_«@name»(_obj, false, &mime_text, false);
if (status)
if (status) {
throw_pEp_Exception(env, status);
}
jbyteArray result = from_string(env, mime_text);
free(mime_text);
return result;
}
@ -134,7 +143,8 @@ tstylesheet {
with "name", "concat('set', $jname)";
}
||
JNIEXPORT `call "jni_type" with "type", "name(.)"` JNICALL «$getname»(JNIEnv *env, jobject obj)
JNIEXPORT `call "jni_type" with "type", "name(.)"` JNICALL «$getname»(JNIEnv *env,
jobject obj)
{
pEpLog("called");
«$name» *_obj = «$name»_ptr(env, obj);
@ -148,7 +158,10 @@ tstylesheet {
||
}
JNIEXPORT void JNICALL «$setname»(JNIEnv *env, jobject obj, `call "jni_type" with "type", "name(.)"` value)
JNIEXPORT void JNICALL «$setname»(JNIEnv *env,
jobject obj,
`call "jni_type" with "type", "name(.)"`
value)
{
pEpLog("called");
«$name» *_obj = «$name»_ptr(env, obj);
@ -171,7 +184,7 @@ tstylesheet {
|> free_«$free»(_obj->«$cname»);
}
}
|> if(value){
|> if(value) {
choose {
when "$type = 'string'" {
|>> _obj->«$cname» = to_«$type»(env, value);
@ -180,9 +193,9 @@ tstylesheet {
|>> _obj->«$cname» = to_«$type»(env, value);
}
}
|> }else{
|> } else {
|> _obj->«$cname» = NULL;
|> }
|> }
}
}
||


+ 57
- 104
src/cxx/basic_api.cc View File

@ -12,15 +12,14 @@
#include "passphrase_callback.hh"
extern "C" {
using namespace pEp::JNIAdapter;
using pEp::Adapter::session;
using pEp::passphrase_cache;
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1trustwords(
JNIEnv *env,
using namespace pEp::JNIAdapter;
using pEp::Adapter::session;
using pEp::passphrase_cache;
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1trustwords(JNIEnv *env,
jobject obj,
jobject ident
)
jobject ident)
{
std::mutex *mutex_local = nullptr;
{
@ -37,10 +36,11 @@ JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1trustwords(
PEP_STATUS status = PEP_STATUS_OK;
if (_ident->fpr == NULL || _ident->fpr[0] == 0) {
if (_ident->me)
if (_ident->me) {
status = passphraseWrap(::myself, session(), _ident);
else
} else {
status = passphraseWrap(::update_identity, session(), _ident);
}
}
if (status != PEP_STATUS_OK) {
@ -54,13 +54,13 @@ JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1trustwords(
}
const char *lang;
if (_ident->lang[0])
if (_ident->lang[0]) {
lang = _ident->lang;
else
} else {
lang = "en";
}
status = passphraseWrap(::trustwords,
session(), static_cast<const char*>(_ident->fpr), lang, &words, &wsize, 10);
status = passphraseWrap(::trustwords, session(), static_cast<const char *>(_ident->fpr), lang, &words, &wsize, 10);
if (status != PEP_STATUS_OK) {
throw_pEp_Exception(env, status);
@ -70,11 +70,9 @@ JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1trustwords(
return from_string(env, words);
}
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1myself(
JNIEnv *env,
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1myself(JNIEnv *env,
jobject obj,
jobject ident
)
jobject ident)
{
std::mutex *mutex_local = nullptr;
{
@ -96,11 +94,9 @@ JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1myself(
return from_identity(env, _ident);
}
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1updateIdentity(
JNIEnv *env,
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1updateIdentity(JNIEnv *env,
jobject obj,
jobject ident
)
jobject ident)
{
std::mutex *mutex_local = nullptr;
{
@ -111,18 +107,15 @@ JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1updateIdentity
std::lock_guard<std::mutex> l(*mutex_local);
pEp_identity *_ident = to_identity(env, ident);
passphraseWrap(::update_identity, session(), _ident);
return from_identity(env, _ident);
}
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1setOwnKey(
JNIEnv *env,
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1setOwnKey(JNIEnv *env,
jobject obj,
jobject ident,
jbyteArray fpr
)
jbyteArray fpr)
{
std::mutex *mutex_local = nullptr;
{
@ -146,11 +139,9 @@ JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1setOwnKey(
return from_identity(env, _ident);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1keyMistrusted(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1keyMistrusted(JNIEnv *env,
jobject obj,
jobject ident
)
jobject ident)
{
std::mutex *mutex_local = nullptr;
{
@ -184,11 +175,9 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1keyMistrusted(
passphraseWrap(::key_mistrusted, session(), _ident);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1keyResetTrust(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1keyResetTrust(JNIEnv *env,
jobject obj,
jobject ident
)
jobject ident)
{
std::mutex *mutex_local = nullptr;
{
@ -203,10 +192,11 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1keyResetTrust(
PEP_STATUS status = PEP_STATUS_OK;
if (_ident->fpr == NULL || _ident->fpr[0] == 0) {
if (_ident->me)
if (_ident->me) {
status = passphraseWrap(::myself, session(), _ident);
else
} else {
status = passphraseWrap(::update_identity, session(), _ident);
}
}
if (status != PEP_STATUS_OK) {
@ -222,11 +212,9 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1keyResetTrust(
passphraseWrap(::key_reset_trust, session(), _ident);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1trustPersonalKey(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1trustPersonalKey(JNIEnv *env,
jobject obj,
jobject ident
)
jobject ident)
{
std::mutex *mutex_local = nullptr;
{
@ -241,10 +229,11 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1trustPersonalKey(
PEP_STATUS status = PEP_STATUS_OK;
if (_ident->fpr == NULL || _ident->fpr[0] == 0) {
if (_ident->me)
if (_ident->me) {
status = passphraseWrap(::myself, session(), _ident);
else
} else {
status = passphraseWrap(::update_identity, session(), _ident);
}
}
if (status != PEP_STATUS_OK) {
@ -260,11 +249,9 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1trustPersonalKey(
passphraseWrap(::trust_personal_key, session(), _ident);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1trustOwnKey(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1trustOwnKey(JNIEnv *env,
jobject obj,
jobject ident
)
jobject ident)
{
std::mutex *mutex_local = nullptr;
{
@ -284,11 +271,9 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1trustOwnKey(
passphraseWrap(::trust_own_key, session(), _ident);
}
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1importKey(
JNIEnv *env,
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1importKey(JNIEnv *env,
jobject obj,
jbyteArray key
)
jbyteArray key)
{
std::mutex *mutex_local = nullptr;
{
@ -301,7 +286,7 @@ JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1importKey(
size_t _size = static_cast<size_t>(env->GetArrayLength(key));
jbyte* _key = env->GetByteArrayElements(key, NULL);
if(_key == NULL){
if(_key == NULL) {
throw_pEp_Exception(env, PEP_OUT_OF_MEMORY);
return NULL;
}
@ -324,11 +309,9 @@ JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine__1importKey(
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passive_1mode(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passive_1mode(JNIEnv *env,
jobject obj,
jboolean enable
)
jboolean enable)
{
std::mutex *mutex_local = nullptr;
{
@ -342,11 +325,9 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passive_1
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1unencrypted_1subject(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1unencrypted_1subject(JNIEnv *env,
jobject obj,
jboolean enable
)
jboolean enable)
{
std::mutex *mutex_local = nullptr;
{
@ -359,8 +340,7 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1unencrypt
::config_unencrypted_subject(session(), static_cast<bool>(enable));
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1add(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1add(JNIEnv *env,
jobject obj,
jbyteArray fpr
)
@ -385,14 +365,11 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1add(
throw_pEp_Exception(env, status);
return;
}
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1delete(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1delete(JNIEnv *env,
jobject obj,
jbyteArray fpr
)
jbyteArray fpr)
{
std::mutex *mutex_local = nullptr;
{
@ -417,11 +394,9 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1delete
}
JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1is_1listed(
JNIEnv *env,
JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1is_1listed(JNIEnv *env,
jobject obj,
jbyteArray fpr
)
jbyteArray fpr)
{
std::mutex *mutex_local = nullptr;
{
@ -448,12 +423,10 @@ JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_Engine__1blacklist_1is
return (jboolean)_listed;
}
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getCrashdumpLog(
JNIEnv *env,
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getCrashdumpLog(JNIEnv *env,
jobject obj,
jint dummy,
jint maxlines
)
jint maxlines)
{
std::mutex *mutex_local = nullptr;
{
@ -477,40 +450,24 @@ JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getCrashdum
return from_string(env, _logdata);
}
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getUserDirectory(
JNIEnv *env,
jobject obj
)
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getUserDirectory(JNIEnv *env,
jobject obj)
{
pEpLog("called");
return from_string(env, ::per_user_directory());
}
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getMachineDirectory(
JNIEnv *env,
jobject obj
)
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getMachineDirectory(JNIEnv *env,
jobject obj)
{
pEpLog("called");
return from_string(env, ::per_machine_directory());
}
//void logPassphraseCache() {
// try {
//// while(true) {
// pEpLog("Cache: '" << cache.latest_passphrase() << "'");
//// }
// } catch(pEp::PassphraseCache::Empty e) {
// pEpLog(e.what());
// } catch(pEp::PassphraseCache::Exhausted ex) {
// pEpLog(ex.what());
// }
//}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphrase
(JNIEnv * env,
jobject obj,
jbyteArray passphrase)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphrase(JNIEnv * env,
jobject obj,
jbyteArray passphrase)
{
std::mutex *mutex_local = nullptr;
{
@ -530,12 +487,10 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphras
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphrase_1for_1new_1keys(
JNIEnv *env,
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphrase_1for_1new_1keys(JNIEnv *env,
jobject obj,
jboolean enable,
jbyteArray passphrase
)
jbyteArray passphrase)
{
std::mutex *mutex_local = nullptr;
{
@ -555,8 +510,6 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphras
throw_pEp_Exception(env, status);
return ;
}
}
} // extern "C"


+ 82
- 86
src/cxx/foundation_pEp_jniadapter_AbstractEngine.cc View File

@ -15,9 +15,7 @@ using namespace pEp::JNIAdapter;
using namespace utility; // for libpEpAdapter locked queue impl. TODO:rename
bool first = true;
JavaVM *jvm= nullptr;
std::mutex mutex_obj;
jfieldID signal_field_value = nullptr;
@ -67,45 +65,60 @@ namespace JNISync {
void jni_init() {
JNIEnv *_env = JNISync::env();
messageClass = static_cast<jclass>(
_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/Message")));
identityClass = static_cast<jclass>(
_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/_Identity")));
signalClass = static_cast<jclass>(
_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/SyncHandshakeSignal")));
passphraseTypeClass = static_cast<jclass>(
_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/PassphraseType")));
JNIEnv * _env = JNISync::env();
messageClass = static_cast<jclass>(_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/Message")));
identityClass = static_cast<jclass>(_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/_Identity")));
signalClass = static_cast<jclass>(_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/SyncHandshakeSignal")));
passphraseTypeClass = static_cast<jclass>(_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/PassphraseType")));
engineClass = static_cast<jclass>(_env->NewGlobalRef(findClass(_env, "foundation/pEp/jniadapter/Engine")));
messageConstructorMethodID = _env->GetMethodID(messageClass, "<init>", "(J)V");
messageConstructorMethodID = _env->GetMethodID(
messageClass,
"<init>",
"(J)V");
messageToSendMethodID = _env->GetMethodID(
engineClass,
"messageToSendCallFromC",
"(Lfoundation/pEp/jniadapter/Message;)I");
engineClass,
"messageToSendCallFromC",
"(Lfoundation/pEp/jniadapter/Message;)I");
needsFastPollMethodID = _env->GetMethodID(
engineClass,
"needsFastPollCallFromC",
"(Z)I");
engineClass,
"needsFastPollCallFromC",
"(Z)I");
notifyHandShakeMethodID = _env->GetMethodID(
engineClass,
"notifyHandshakeCallFromC",
"(Lfoundation/pEp/jniadapter/_Identity;Lfoundation/pEp/jniadapter/_Identity;Lfoundation/pEp/jniadapter/SyncHandshakeSignal;)I");
engineClass,
"notifyHandshakeCallFromC",
"(Lfoundation/pEp/jniadapter/_Identity;Lfoundation/pEp/jniadapter/_Identity;Lfoundation/pEp/jniadapter/SyncHandshakeSignal;)I");
passphraseRequiredMethodID = _env->GetMethodID(
engineClass,
"passphraseRequiredFromC",
"(Lfoundation/pEp/jniadapter/PassphraseType;)[B");
sync_handshake_signal_values = JNISync::env()->GetStaticMethodID(signalClass, "values",
"()[Lfoundation/pEp/jniadapter/SyncHandshakeSignal;");
passphrase_status_values = JNISync::env()->GetStaticMethodID(passphraseTypeClass, "values",
"()[Lfoundation/pEp/jniadapter/PassphraseType;");
signal_field_value = JNISync::env()->GetFieldID(signalClass, "value", "I");
passphrase_type_field_value = JNISync::env()->GetFieldID(passphraseTypeClass, "value", "I");
engineClass,
"passphraseRequiredFromC",
"(Lfoundation/pEp/jniadapter/PassphraseType;)[B");
sync_handshake_signal_values = JNISync::env()->GetStaticMethodID(
signalClass,
"values",
"()[Lfoundation/pEp/jniadapter/SyncHandshakeSignal;");
passphrase_status_values = JNISync::env()->GetStaticMethodID(
passphraseTypeClass,
"values",
"()[Lfoundation/pEp/jniadapter/PassphraseType;");
signal_field_value = JNISync::env()->GetFieldID(
signalClass,
"value",
"I");
passphrase_type_field_value = JNISync::env()->GetFieldID(passphraseTypeClass, "value", "I");
}
char* JNIAdapter::passphraseRequiredCallback(const PEP_STATUS status) {
char* JNIAdapter::passphraseRequiredCallback(
const PEP_STATUS status)
{
pEpLog("called");
jobject status_ = nullptr;
{
@ -113,8 +126,7 @@ char* JNIAdapter::passphraseRequiredCallback(const PEP_STATUS status) {
assert(passphrase_status_values);
assert(passphrase_type_field_value);
jobjectArray values = static_cast<jobjectArray>(JNISync::env()->CallStaticObjectMethod(passphraseTypeClass,
passphrase_status_values));
jobjectArray values = static_cast<jobjectArray>(JNISync::env()->CallStaticObjectMethod(passphraseTypeClass, passphrase_status_values));
if (JNISync::env()->ExceptionCheck()) {
JNISync::env()->ExceptionClear();
@ -149,19 +161,21 @@ char* JNIAdapter::passphraseRequiredCallback(const PEP_STATUS status) {
PEP_STATUS messageToSend(message *msg)
{
std::lock_guard<std::mutex> l(mutex_obj);
std::lock_guard <std::mutex> l(mutex_obj);
pEpLog("called");
// Passphrase
// When a protocol implementation of the p≡p engine using messageToSend() cannot sign or encrypt with an
// empty passphrase and not with the configured passphrase it is calling messageToSend() with a NULL instead
// of a struct _message object.
if (Adapter::on_sync_thread() && !msg)
if (Adapter::on_sync_thread() && !msg) {
return pEp::PassphraseCache::config_next_passphrase();
}
// reset passphrase iterator
if (Adapter::on_sync_thread())
if (Adapter::on_sync_thread()) {
pEp::PassphraseCache::config_next_passphrase(true);
}
jobject msg_ = nullptr;
assert(messageClass && messageConstructorMethodID && objj && messageToSendMethodID);
@ -175,11 +189,12 @@ PEP_STATUS messageToSend(message *msg)
JNISync::env()->ExceptionClear();
}
return status;
}
PEP_STATUS notifyHandshake(pEp_identity *me, pEp_identity *partner, sync_handshake_signal signal)
PEP_STATUS notifyHandshake(pEp_identity *me,
pEp_identity *partner,
sync_handshake_signal signal)
{
std::lock_guard<std::mutex> l(mutex_obj);
pEpLog("called");
@ -196,8 +211,7 @@ PEP_STATUS notifyHandshake(pEp_identity *me, pEp_identity *partner, sync_handsha
assert(sync_handshake_signal_values);
assert(signal_field_value);
jobjectArray values = static_cast<jobjectArray>(JNISync::env()->CallStaticObjectMethod(signalClass,
sync_handshake_signal_values));
jobjectArray values = static_cast<jobjectArray>(JNISync::env()->CallStaticObjectMethod(signalClass, sync_handshake_signal_values));
if (JNISync::env()->ExceptionCheck()) {
JNISync::env()->ExceptionClear();
return PEP_UNKNOWN_ERROR;
@ -231,10 +245,8 @@ PEP_STATUS notifyHandshake(pEp_identity *me, pEp_identity *partner, sync_handsha
extern "C" {
using namespace pEp;
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_init(
JNIEnv *env,
jobject obj
)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_init(JNIEnv *env,
jobject obj)
{
std::lock_guard<std::mutex> l(global_mutex); // global mutex for write access to <unordered_map>
pEpLog("called");
@ -253,10 +265,8 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_init(
Adapter::session();
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_release(
JNIEnv *env,
jobject obj
)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_release(JNIEnv *env,
jobject obj)
{
std::lock_guard<std::mutex> l(global_mutex); // global mutex for write access to <unordered_map>
pEpLog("called");
@ -264,10 +274,8 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_release(
Adapter::session(pEp::Adapter::release);
}
JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1getVersion(
JNIEnv *env,
jobject obj
)
JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1getVersion(JNIEnv *env,
jobject obj)
{
std::mutex *mutex_local = nullptr;
{
@ -280,10 +288,8 @@ JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1getVer
return env->NewStringUTF(::get_engine_version());
}
JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1getProtocolVersion(
JNIEnv *env,
jobject obj
)
JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1getProtocolVersion(JNIEnv *env,
jobject obj)
{
std::mutex *mutex_local = nullptr;
{
@ -296,9 +302,10 @@ JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1getPro
return env->NewStringUTF(::get_protocol_version());
}
int examine_identity(pEp_identity *ident, void *arg)
int examine_identity(pEp_identity *ident,
void *arg)
{
locked_queue< pEp_identity * > *queue = static_cast<locked_queue<pEp_identity*>*>(arg);
locked_queue < pEp_identity * > *queue = static_cast<locked_queue < pEp_identity * > * > (arg);
queue->push_back(identity_dup(ident));
return 0;
}
@ -306,10 +313,11 @@ int examine_identity(pEp_identity *ident, void *arg)
pEp_identity *retrieve_next_identity(void *arg)
{
pEpLog("called");
locked_queue< pEp_identity * > *queue = static_cast<locked_queue<pEp_identity*>*>(arg);
locked_queue < pEp_identity * > *queue = static_cast<locked_queue < pEp_identity * > * > (arg);
while (!queue->size())
while (!queue->size()) {
usleep(100000);
}
pEp_identity *ident = queue->front();
queue->pop_front();
@ -319,7 +327,7 @@ pEp_identity *retrieve_next_identity(void *arg)
static void *keyserver_thread_routine(void *arg)
{
PEP_STATUS status = do_keymanagement(retrieve_next_identity, arg);
locked_queue< pEp_identity * > *queue = static_cast<locked_queue<pEp_identity*>*>(arg);
locked_queue < pEp_identity * > *queue = static_cast<locked_queue < pEp_identity * > * > (arg);
while (queue->size()) {
pEp_identity *ident = queue->front();
@ -328,13 +336,11 @@ static void *keyserver_thread_routine(void *arg)
}
delete queue;
return reinterpret_cast<void*>(status);
return reinterpret_cast<void *>(status);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1startKeyserverLookup(
JNIEnv *env,
jobject obj
)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1startKeyserverLookup(JNIEnv *env,
jobject obj)
{
std::mutex *mutex_local = nullptr;
{
@ -375,10 +381,8 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1startKeys
pthread_create(thread, nullptr, keyserver_thread_routine, static_cast<void*>(queue));
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1stopKeyserverLookup(
JNIEnv *env,
jobject obj
)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1stopKeyserverLookup(JNIEnv *env,
jobject obj)
{
std::mutex *mutex_local = nullptr;
{
@ -419,10 +423,8 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1stopKeyse
free(thread);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1startSync(
JNIEnv *env,
jobject obj
)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1startSync(JNIEnv *env,
jobject obj)
{
std::mutex *mutex_local = nullptr;
{
@ -434,17 +436,14 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1startSync
try {
CallbackDispatcher::start_sync();
// Adapter::startup<JNISync>(messageToSend, notifyHandshake, &o, &JNISync::onSyncStartup, &JNISync::onSyncShutdown);
} catch (RuntimeError& ex) {
throw_pEp_Exception(env, ex.status);
return;
}
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1stopSync(
JNIEnv *env,
jobject obj
)
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1stopSync(JNIEnv *env,
jobject obj)
{
std::mutex *mutex_local = nullptr;
{
@ -455,13 +454,10 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1stopSync(
std::lock_guard<std::mutex> l(*mutex_local);
CallbackDispatcher::stop_sync();
// Adapter::shutdown();
}
JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1isSyncRunning(
JNIEnv *env,
jobject obj
)
JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1isSyncRunning(JNIEnv *env,
jobject obj)
{
std::mutex *mutex_local = nullptr;
{


+ 25
- 20
src/cxx/foundation_pEp_jniadapter__Blob.cc View File

@ -8,39 +8,43 @@
#include "foundation_pEp_jniadapter__Blob.h"
namespace pEp {
namespace JNIAdapter {
static ::bloblist_t *bloblist_ptr(JNIEnv *env, jobject me) {
jfieldID handle;
namespace JNIAdapter {
try {
handle = getFieldID(env, "foundation/pEp/jniadapter/Blob", "mime_type", "Ljava/lang/String");
}
catch (std::exception& ex) {
assert(0);
return NULL;
}
static ::bloblist_t *bloblist_ptr(JNIEnv *env, jobject me) {
jfieldID handle;
return reinterpret_cast<::bloblist_t*>(env->GetLongField(me, handle));
}
};
};
try {
handle = getFieldID(env, "foundation/pEp/jniadapter/Blob", "mime_type", "Ljava/lang/String");
} catch (std::exception &ex) {
assert(0);
return NULL;
}
return reinterpret_cast<::bloblist_t *>(env->GetLongField(me, handle));
}
}; //namespace JNIAdapter
}; //namespace pEp
extern "C" {
using namespace std;
using namespace pEp::JNIAdapter;
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter__1Blob__1dataToXER(JNIEnv *env, jobject obj)
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter__1Blob__1dataToXER(JNIEnv *env,
jobject obj)
{
pEpLog("called");
bloblist_t *b = to_blob(env, obj);
char *out = nullptr;
// RFC 1049 / RFC 2045 : The type, subtype, and parameter names are not case sensitive.
if(strcasecmp(b->mime_type, "application/pEp.sync") == 0) {
if (strcasecmp(b->mime_type, "application/pEp.sync") == 0) {
PEP_STATUS status = ::PER_to_XER_Sync_msg(b->value, static_cast<size_t>(b->size), &out);
if (status)
if (status) {
throw_pEp_Exception(env, status);
}
jbyteArray result = from_string(env, out);
free(out);
@ -48,17 +52,18 @@ JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter__1Blob__1dataToXER(J
}
// RFC 1049 / RFC 2045 : The type, subtype, and parameter names are not case sensitive.
if(strcasecmp(b->mime_type, "application/pEp.keyreset") == 0) {
if (strcasecmp(b->mime_type, "application/pEp.keyreset") == 0) {
PEP_STATUS status = ::PER_to_XER_Distribution_msg(b->value, static_cast<size_t>(b->size), &out);
if (status)
if (status) {
throw_pEp_Exception(env, status);
}
jbyteArray result = from_string(env, out);
free(out);
return result;
}
return from_string(env,b->value);
return from_string(env, b->value);
}
}; // extern "C"

+ 4
- 2
src/cxx/identity_api.cc View File

@ -3,10 +3,12 @@
#include "jniutils.hh"
extern "C" {
JNIEXPORT jint JNICALL Java_foundation_pEp_jniadapter_Identity__1getRating(JNIEnv *env, jobject thiz, jint comm_type)
JNIEXPORT jint JNICALL Java_foundation_pEp_jniadapter_Identity__1getRating(
JNIEnv *env,
jobject thiz,
jint comm_type)
{
pEpLog("called");
return ::rating_from_comm_type(static_cast<PEP_comm_type>(comm_type));


+ 780
- 755
src/cxx/jniutils.cc
File diff suppressed because it is too large
View File


+ 124
- 107
src/cxx/jniutils.hh View File

@ -1,4 +1,5 @@
#pragma once
#include <unordered_map>
#include <thread>
#include <mutex>
@ -19,112 +20,128 @@
#endif
namespace pEp {
namespace JNIAdapter {
// Global mutex needs to be locked in all constructors which insert their own mutex object
// into the unordered_map (which is thread safe for read, but not for write)
extern std::mutex global_mutex;
// Stores mutex per java object
extern std::unordered_map<long, std::mutex*> engine_objid_mutex;
// needs to be called after create_engine_java_object_mutex()
// and before release_engine_java_object_mutex()
// Thread safe
std::mutex* get_engine_java_object_mutex(
JNIEnv *env,
jobject me
);
// Needs to be called exactly once per obj, in the constructor of the obj
// You need to lock a global mutex before calling this function (write to unordered_map)
void create_engine_java_object_mutex(
JNIEnv *env,
jobject me
);
// Needs to be called exactly once per obj, in the destructor of this obj
// You need to lock a global mutex before calling this function (write to unordered_map)
void release_engine_java_object_mutex(
JNIEnv *env,
jobject me
);
jclass findClass(JNIEnv *env, const char *classname);
jfieldID getFieldID(
JNIEnv *env,
const char *classname,
const char *fieldname,
const char *signature
);
jfieldID getFieldID(
JNIEnv *env,
const char *classname,
const char *fieldname,
const char *signature,
const jclass clazz
);
jint callIntMethod(
JNIEnv *env,
jobject obj,
const char *methodname
);
jlong callLongMethod(
JNIEnv *env,
jobject obj,
const char *methodname
);
jobject callObjectMethod(
JNIEnv *env,
jobject obj,
const char *methodname,
jint index
);
jboolean callBooleanMethod(
JNIEnv *env,
jobject obj,
const char *methodname,
jobject o
);
jint outOfMemory(JNIEnv *env);
jobject from_Integer(JNIEnv *env, int val);
int to_Integer(JNIEnv *env, jobject obj);
jbyteArray from_string(JNIEnv *env, const char *str);
char *to_string(JNIEnv *env, jbyteArray str);
jobject from_stringlist(JNIEnv *env, stringlist_t *sl);
stringlist_t *to_stringlist(JNIEnv *env, jobject obj);
jobject from_stringpairlist(JNIEnv *env, stringpair_list_t *sl);
stringpair_list_t *to_stringpairlist(JNIEnv *env, jobject obj);
jobject from_timestamp(JNIEnv *env, timestamp *ts);
timestamp *to_timestamp(JNIEnv *env, jobject date);
jobject from_identity(JNIEnv *env, pEp_identity *ident);
jobject from_identity(JNIEnv *env, pEp_identity *ident, jclass identityClass);
pEp_identity *to_identity(JNIEnv *env, jobject obj);
jobject from_identitylist(JNIEnv *env, identity_list *il);
identity_list *to_identitylist(JNIEnv *env, jobject obj);
jobject from_bloblist(JNIEnv *env, bloblist_t *bl);
bloblist_t *to_blob(JNIEnv *env, jobject obj);
bloblist_t *to_bloblist(JNIEnv *env, jobject obj);
PEP_enc_format to_EncFormat(JNIEnv *env, jobject obj);
PEP_CIPHER_SUITE to_CipherSuite(JNIEnv *env, jobject obj);
sync_handshake_result to_SyncHandshakeResult(JNIEnv *env, jobject obj);
};
namespace JNIAdapter {
// Global mutex needs to be locked in all constructors which insert their own mutex object
// into the unordered_map (which is thread safe for read, but not for write)
extern std::mutex global_mutex;
// Stores mutex per java object
extern std::unordered_map<long, std::mutex *> engine_objid_mutex;
// needs to be called after create_engine_java_object_mutex()
// and before release_engine_java_object_mutex()
// Thread safe
std::mutex *get_engine_java_object_mutex(JNIEnv *env,
jobject me);
// Needs to be called exactly once per obj, in the constructor of the obj
// You need to lock a global mutex before calling this function (write to unordered_map)
void create_engine_java_object_mutex(JNIEnv *env,
jobject me);
// Needs to be called exactly once per obj, in the destructor of this obj
// You need to lock a global mutex before calling this function (write to unordered_map)
void release_engine_java_object_mutex(JNIEnv *env,
jobject me);
jclass findClass(JNIEnv *env,
const char *classname);
jfieldID getFieldID(JNIEnv *env,
const char *classname,
const char *fieldname,
const char *signature);
jfieldID getFieldID(JNIEnv *env,
const char *classname,
const char *fieldname,
const char *signature,
const jclass clazz);
jint callIntMethod(JNIEnv *env,
jobject obj,
const char *methodname);
jlong callLongMethod(JNIEnv *env,
jobject obj,
const char *methodname);
jobject callObjectMethod(JNIEnv *env,
jobject obj,
const char *methodname,
jint index);
jboolean callBooleanMethod(JNIEnv *env,
jobject obj,
const char *methodname,
jobject o);
jint outOfMemory(JNIEnv *env);
jobject from_Integer(JNIEnv *env,
int val);
int to_Integer(JNIEnv *env,
jobject obj);
jbyteArray from_string(JNIEnv *env,
const char *str);
char *to_string(JNIEnv *env,
jbyteArray str);
jobject from_stringlist(JNIEnv *env,
stringlist_t *sl);
stringlist_t *to_stringlist(JNIEnv *env,
jobject obj);
jobject from_stringpairlist(JNIEnv *env,
stringpair_list_t *sl);
stringpair_list_t *to_stringpairlist(JNIEnv *env,
jobject obj);
jobject from_timestamp(JNIEnv *env,
timestamp *ts);
timestamp *to_timestamp(JNIEnv *env,
jobject date);
jobject from_identity(JNIEnv *env,
pEp_identity *ident);
jobject from_identity(JNIEnv *env,
pEp_identity *ident,
jclass identityClass);
pEp_identity *to_identity(JNIEnv *env,
jobject obj);
jobject from_identitylist(JNIEnv *env,
identity_list *il);
identity_list *to_identitylist(JNIEnv *env,
jobject obj);
jobject from_bloblist(JNIEnv *env,
bloblist_t *bl);
bloblist_t *to_blob(JNIEnv *env,
jobject obj);
bloblist_t *to_bloblist(JNIEnv *env,
jobject obj);
PEP_enc_format to_EncFormat(JNIEnv *env,
jobject obj);
PEP_CIPHER_SUITE to_CipherSuite(JNIEnv *env,
jobject obj);
sync_handshake_result to_SyncHandshakeResult(JNIEnv *env,
jobject obj);
};
};

+ 5
- 4
src/cxx/passphrase_callback.hh View File

@ -1,14 +1,15 @@
#pragma once
#include <pEp/passphrase_cache.hh>
namespace pEp {
namespace JNIAdapter {
namespace JNIAdapter {
char* passphraseRequiredCallback(const PEP_STATUS status);
char *passphraseRequiredCallback(const PEP_STATUS status);
template<typename... A> PEP_STATUS passphraseWrap(PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a);
template<typename... A> PEP_STATUS passphraseWrap(PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a);
}
}
}
#include "passphrase_callback.hxx"

+ 34
- 34
src/cxx/passphrase_callback.hxx View File

@ -3,40 +3,40 @@
#include "passphrase_callback.hh"
namespace pEp {
namespace JNIAdapter {
namespace JNIAdapter {
template<typename... A> PEP_STATUS passphraseWrap(PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a) {
pEpLog("cached passphrase mode");
bool retryAgain = false;
int maxRetries = 3;
int retryCount = 0;
PEP_STATUS status;
do {
// the actual target function
pEpLog("calling passphrase_cache.api from basic_api");
status = passphrase_cache.api(f, session, a...);
pEpLog("PEP_STATUS:" << status);
if (status == PEP_PASSPHRASE_REQUIRED ||
status == PEP_WRONG_PASSPHRASE ||
status == PEP_PASSPHRASE_FOR_NEW_KEYS_REQUIRED)
{
pEpLog("none of the cached passphrases worked");
if (retryCount < maxRetries) {
// call the app
char *_passphrase = passphraseRequiredCallback(status);
pEpLog("callback returned, config_passphrase() with new passphrase");
PEP_STATUS status = ::config_passphrase(session, passphrase_cache.add(_passphrase));
retryAgain = true;
retryCount++;
} else {
pEpLog("max retries reached:" << maxRetries);
retryAgain = false;
}
} else {
retryAgain = false;
}
} while (retryAgain);
return status;
template<typename... A> PEP_STATUS passphraseWrap(PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a) {
pEpLog("cached passphrase mode");
bool retryAgain = false;
int maxRetries = 3;
int retryCount = 0;
PEP_STATUS status;
do {
// the actual target function
pEpLog("calling passphrase_cache.api from basic_api");
status = passphrase_cache.api(f, session, a...);
pEpLog("PEP_STATUS:" << status);
if (status == PEP_PASSPHRASE_REQUIRED ||
status == PEP_WRONG_PASSPHRASE ||
status == PEP_PASSPHRASE_FOR_NEW_KEYS_REQUIRED)
{
pEpLog("none of the cached passphrases worked");
if (retryCount < maxRetries) {
// call the app
char *_passphrase = passphraseRequiredCallback(status);
pEpLog("callback returned, config_passphrase() with new passphrase");
PEP_STATUS status = ::config_passphrase(session, passphrase_cache.add(_passphrase));
retryAgain = true;
retryCount++;
} else {
pEpLog("max retries reached:" << maxRetries);
retryAgain = false;
}
} else {
retryAgain = false;
}
}
} while (retryAgain);
return status;
}
}
}

Loading…
Cancel
Save