diff options
| author | 彭宣正 <[email protected]> | 2020-11-23 11:01:49 +0800 |
|---|---|---|
| committer | 彭宣正 <[email protected]> | 2020-12-01 16:16:55 +0800 |
| commit | c3fc52b5b0b9601fbd6abbe1fc508184a3e0cbf6 (patch) | |
| tree | fb1bc0543663d8f9f8934bd1990f8a17e22af9ae /src | |
| parent | c6d6eec4dfb2a0aac2d46ea39d7b55b30d78f0b2 (diff) | |
去掉hos_init_api和hos_shutdown_api
Diffstat (limited to 'src')
| -rw-r--r-- | src/hos_client.cpp | 16 | ||||
| -rw-r--r-- | src/hos_client.h | 9 |
2 files changed, 4 insertions, 21 deletions
diff --git a/src/hos_client.cpp b/src/hos_client.cpp index 27cced9a..7b4cb180 100644 --- a/src/hos_client.cpp +++ b/src/hos_client.cpp @@ -152,18 +152,6 @@ void hos_set_thread_sum(hos_client_handle client, size_t thread_sum) return ; } -void hos_init_api() -{ - //options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Debug; - Aws::InitAPI(options); -} - -void hos_shutdown_api() -{ - //options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Debug; - Aws::ShutdownAPI(options); -} - hos_client_handle hos_client_create(const char *endpoint, const char *accesskeyid, const char *secretkey, size_t pool_size) { if (!endpoint || !accesskeyid || !secretkey) @@ -175,6 +163,8 @@ hos_client_handle hos_client_create(const char *endpoint, const char *accesskeyi { return hos_handle; } + + Aws::InitAPI(options); hos_handle = (hos_client_handle)malloc(sizeof(hos_client_handle_t)); memset(hos_handle, 0, sizeof(hos_client_handle_t)); Aws::Client::ClientConfiguration config; @@ -814,5 +804,7 @@ int hos_client_destory(hos_client_handle handle) } free(handle); + Aws::ShutdownAPI(options); + return HOS_CLIENT_OK; } diff --git a/src/hos_client.h b/src/hos_client.h index a53d23b5..c549f372 100644 --- a/src/hos_client.h +++ b/src/hos_client.h @@ -75,15 +75,6 @@ enum s3errors typedef void (*put_finished_callback)(bool, const char *, const char *, const char *, void *); - -/************************************************************************************* - * 函数名: hos_init_api -*************************************************************************************/ -void hos_init_api(); -/************************************************************************************* - * 函数名: hos_shutdown_api -*************************************************************************************/ -void hos_shutdown_api(); /************************************************************************************* * 函数名: hos_client_init * 参数: const char *endpoint 目的地址,如”http://192.168.44.12:9098/hos“ |
