|
24 | 24 | #include <memory> |
25 | 25 | #include <sstream> |
26 | 26 | #include <string> |
| 27 | +#include <utility> |
27 | 28 | #include <vector> |
28 | 29 |
|
29 | 30 | #include "olp/core/context/Context.h" |
30 | 31 | #include "olp/core/http/HttpStatusCode.h" |
31 | 32 | #include "olp/core/logging/Log.h" |
32 | 33 | #include "olp/core/porting/make_unique.h" |
| 34 | +#include "olp/core/utils/Credentials.h" |
33 | 35 |
|
34 | 36 | #include "utils/JNIScopedLocalReference.h" |
35 | 37 | #include "utils/JNIThreadBinder.h" |
@@ -384,15 +386,20 @@ bool NetworkAndroid::Initialize() { |
384 | 386 | if (!natives_registered) { |
385 | 387 | JNINativeMethod methods[] = { |
386 | 388 | {"headersCallback", "(J[Ljava/lang/String;)V", |
387 | | - (void*)&Java_com_here_olp_network_HttpClient_headersCallback}, |
| 389 | + reinterpret_cast<void*>( |
| 390 | + &Java_com_here_olp_network_HttpClient_headersCallback)}, |
388 | 391 | {"dateAndOffsetCallback", "(JJJ)V", |
389 | | - (void*)&Java_com_here_olp_network_HttpClient_dateAndOffsetCallback}, |
| 392 | + reinterpret_cast<void*>( |
| 393 | + &Java_com_here_olp_network_HttpClient_dateAndOffsetCallback)}, |
390 | 394 | {"dataCallback", "(J[BI)V", |
391 | | - (void*)&Java_com_here_olp_network_HttpClient_dataCallback}, |
| 395 | + reinterpret_cast<void*>( |
| 396 | + &Java_com_here_olp_network_HttpClient_dataCallback)}, |
392 | 397 | {"completeRequest", "(JIIILjava/lang/String;Ljava/lang/String;)V", |
393 | | - (void*)&Java_com_here_olp_network_HttpClient_completeRequest}, |
| 398 | + reinterpret_cast<void*>( |
| 399 | + &Java_com_here_olp_network_HttpClient_completeRequest)}, |
394 | 400 | {"resetRequest", "(J)V", |
395 | | - (void*)&Java_com_here_olp_network_HttpClient_resetRequest}}; |
| 401 | + reinterpret_cast<void*>( |
| 402 | + &Java_com_here_olp_network_HttpClient_resetRequest)}}; |
396 | 403 |
|
397 | 404 | env->RegisterNatives(java_self_class_, methods, |
398 | 405 | sizeof(methods) / sizeof(methods[0])); |
@@ -670,8 +677,9 @@ void NetworkAndroid::CompleteRequest(JNIEnv* env, RequestId request_id, |
670 | 677 | OLP_SDK_LOG_DEBUG( |
671 | 678 | kLogTag, "CompleteRequest, request_id=" |
672 | 679 | << request_id << ", uploaded_bytes=" << uploaded_bytes |
673 | | - << ", downloaded_bytes=" << downloaded_bytes |
674 | | - << ", url=" << request_data->url << ", status=" << status); |
| 680 | + << ", downloaded_bytes=" << downloaded_bytes << ", url=" |
| 681 | + << olp::utils::CensorCredentialsInUrl(request_data->url) |
| 682 | + << ", status=" << status); |
675 | 683 | // We don't need the object anymore |
676 | 684 | env->DeleteGlobalRef(request_data->obj); |
677 | 685 | request_data->obj = nullptr; |
@@ -917,7 +925,8 @@ SendOutcome NetworkAndroid::Send(NetworkRequest request, |
917 | 925 | env.GetEnv()->ExceptionClear(); |
918 | 926 | return SendOutcome(ErrorCode::IO_ERROR); |
919 | 927 | } |
920 | | - env.GetEnv()->SetByteArrayRegion(jbody, 0, size, (jbyte*)body_data); |
| 928 | + env.GetEnv()->SetByteArrayRegion(jbody, 0, size, |
| 929 | + reinterpret_cast<const jbyte*>(body_data)); |
921 | 930 | } |
922 | 931 | utils::JNIScopedLocalReference body_ref(env.GetEnv(), jbody); |
923 | 932 |
|
|
0 commit comments