Introduce KTLS based http downoader API stub

This commit is contained in:
tarsin committed 2023-06-03 17:37:53 +08:00
1 parent d74b5bff7b
commit a256864c84
3 files changed
+17 -1

No files matched your search

+1 -1
View File
@@ -63,5 +63,5 @@ FetchContent_MakeAvailable(libarchive)
include_directories(${libarchive_SOURCE_DIR}/libarchive)
# Build and link our app's native lib
add_library(${PROJECT_NAME} SHARED archive.c gifutils.c natsort/strnatcmp.c)
add_library(${PROJECT_NAME} SHARED archive.c gifutils.c http_downloader.c natsort/strnatcmp.c)
target_link_libraries(${PROJECT_NAME} archive_static log)
+13
View File
@@ -0,0 +1,13 @@
#include <jni.h>
// This JNI function makes https call and save responseBody directly to filesystem to avoid copy on JVM heap
JNIEXPORT jlong JNICALL
Java_com_hippo_ehviewer_spider_SpiderDenKt_makeHttpsCallAndSaveToFd(JNIEnv *env, jclass clazz,jstring url, jboolean do_sni, jint fd) {
// TODO: implement makeHttpsCallAndSaveToFd()
}
// Is KTLS supported? if not, we maybe use [TLSChannel]https://github.com/marianobarrios/tls-channel and do DirectByteBuffer IO
JNIEXPORT jboolean JNICALL
Java_com_hippo_ehviewer_spider_SpiderDenKt_kernelSupportKTLS(JNIEnv *env, jclass clazz) {
// TODO: implement kernelSupportKTLS()
}