summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorpengxuanzheng <[email protected]>2020-09-14 19:19:50 +0800
committerpengxuanzheng <[email protected]>2020-09-14 19:19:50 +0800
commita00d892928a9ca350e4388e09323fa799bd8fded (patch)
treebc6922cc93fbed1b0fd1ad83db40544998dec8f6 /example
parentcd0649bfbcadaeca8d7e37b31d3e9a191160ce04 (diff)
1.修复SSL connect error 问题
2.修复hos_create_bucket时,出现bucekt already exits的问题 3.修复upload时,远端地址无法解析的问题
Diffstat (limited to 'example')
-rw-r--r--example/CMakeLists.txt3
-rw-r--r--example/single_thread.cpp17
2 files changed, 17 insertions, 3 deletions
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index ff606acf..b9a3f2a9 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -2,7 +2,10 @@ cmake_minimum_required(VERSION 3.5)
set(CMAKE_BUILD_TYPE Debug)
project(singleThread)
+SET(CMAKE_BUILD_TYPE Debug)
link_directories(/usr/local/lib64/)
+link_directories(/opt/MESA/lib/)
+link_libraries(hos_client_cpp)
#set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
add_executable(singleThread single_thread.cpp)
target_link_libraries(singleThread hos_client_cpp)
diff --git a/example/single_thread.cpp b/example/single_thread.cpp
index 71ddc4d5..fe584e2f 100644
--- a/example/single_thread.cpp
+++ b/example/single_thread.cpp
@@ -4,21 +4,32 @@
> Created Time: Fri 11 Sep 2020 09:52:05 AM CST
************************************************************************/
#include<stdio.h>
+#include<unistd.h>
#include"../src/hos_client.h"
int main(int argc, char *argv[])
{
- hos_client_handle handle = hos_client_init("192.168.44.12:9098/hos", "default", "defalut");
+ char *bucket = argv[1];
+ printf("hos_client_init start ...\n");
+ hos_client_handle handle = hos_client_init("http://192.168.44.12:9098/hos", "default", "default");
if (handle == NULL)
{
printf("error:hos_client_handle\n");
return -1;
}
+ printf("hos_client_init success ...");
- hos_create_bucket(handle, "my-first-bucket");
+ printf("hos_create_bucket start ... \n");
+ if(!hos_create_bucket(handle, bucket))
+ {
+ printf("hos_create_bucket failed ... \n");
+ }
+ printf("hos_create_bucket success ... \n");
- hos_upload_async(handle, "my-first-bucket", "my-file.txt");
+ printf("hos_upload_async start ...\n");
+ hos_upload_async(handle, bucket, "my-file.txt");
+ //sleep(30);
hos_client_close(handle);
return 0;