aliyun / aliyun-oss-c-sdk Goto Github PK
View Code? Open in Web Editor NEWAliyun OSS SDK for C
License: MIT License
Aliyun OSS SDK for C
License: MIT License
如上
Linking C static library build/Release/lib/liboss_c_sdk_static.a
[ 47%] Built target oss_c_sdk_static
[ 48%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_sample_util.o
[ 50%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_config.o
[ 51%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/main.o
[ 52%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_put_object_sample.o
[ 53%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_append_object_sample.o
[ 55%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_get_object_sample.o
[ 56%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_head_object_sample.o
[ 57%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_delete_object_sample.o
[ 59%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_multipart_upload_sample.o
[ 60%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_crc_sample.o
[ 61%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_image_sample.o
[ 63%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_progress_sample.o
[ 64%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_callback_sample.o
[ 65%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_list_object_sample.o
[ 67%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_resumable_sample.o
[ 68%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_get_object_meta_sample.o
[ 69%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_put_object_acl_sample.o
[ 71%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_get_object_acl_sample.o
[ 72%] Building C object oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/oss_select_object_sample.o
Linking C executable ../build/Release/bin/oss_c_sdk_sample
/home/cheng/work/shc_gw1230/bu/local/lib/libapr-1.a(apr_snprintf.o): In function `apr_cvt':
strings/apr_snprintf.c:(.text+0x158): undefined reference to `modf'
strings/apr_snprintf.c:(.text+0x1e4): undefined reference to `modf'
strings/apr_snprintf.c:(.text+0x32c): undefined reference to `modf'
collect2: error: ld returned 1 exit status
make[2]: *** [build/Release/bin/oss_c_sdk_sample] Error 1
make[1]: *** [oss_c_sdk_sample/CMakeFiles/oss_c_sdk_sample.dir/all] Error 2
make: *** [all] Error 2
apr make install ok, but build oss then pop error.
文件上传是调用oss_append_object_from_file, 怎么把md5用起来?是放在Content-MD5还是调用后从resp_headers读md5跟本地文件的md5比较?有Demo吗?
aos_table_t *resp_headers使用后怎么释放?
调用oss_head_object(),当object不存在的时候,返回的status如下:
req_id: 56DCFA06DA14FDFF1BC21924
error_code: "UnkonwnError"
error_msg: ""
这里面有两个问题:
Do you have a script to build oss-c-sdk targeting android and ios?
aliyun-oss-c-sdk/CMakeLists.txt
Line 24 in 264839a
这种情况 该如何处理? 需要怎样设置 超时时长? aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_transport.c:456 transport failure curl code:28 error:Timeout was reached
when call aos_request_get, request will be reset to init status.
If we reset request before add to requestStackG, we can release unneed memory.
// related codes:
CURL *aos_request_get()
{
CURL *request = NULL;
apr_thread_mutex_lock(requestStackMutexG);
if (requestStackCountG > 0) {
request = requestStackG[--requestStackCountG];
}
apr_thread_mutex_unlock(requestStackMutexG);
// If we got one, deinitialize it for re-use
if (request) {
curl_easy_reset(request);
}
else {
request = curl_easy_init();
}
return request;
}
void request_release(CURL *request)
{
apr_thread_mutex_lock(requestStackMutexG);
// If the request stack is full, destroy this one
// else put this one at the front of the request stack; we do this because
// we want the most-recently-used curl handle to be re-used on the next
// request, to maximize our chances of re-using a TCP connection before it
// times out
if (requestStackCountG == AOS_REQUEST_STACK_SIZE) {
apr_thread_mutex_unlock(requestStackMutexG);
curl_easy_cleanup(request);
}
else {
requestStackG[requestStackCountG++] = request;
apr_thread_mutex_unlock(requestStackMutexG);
}
}
如下:
2023/10/10 10:54:24 [info] 64531#64531: *147915334 client sent "Content-Length" and "Transfer-Encoding" headers at the same time while reading client request headers, client: 10.16.64.20, server: *.xxxx.com, request: "PUT /aaaaaaa/bbb HTTP/1.1", host: "oss.xxx.com"
使用 oss_resumable_upload_file (开启 checkpoint) 上传文件时存在内存泄漏问题。
重现:
使用官网“断点续传”例子编译运行。https://help.aliyun.com/document_detail/90219.html?spm=a2c4g.11174283.6.1121.40087da23nKquN
mxml-2.12
apr-1.7
apr-util-1.5.1
curl-7.69.1
typedef void (*oss_progress_callback)(int64_t consumed_bytes, int64_t total_bytes);
只有进度信息,但没有对象信息,无法知道是哪个对象的进度信息,希望加一个void*参数进去。这样更加合理方便
调用 OSS C API oss_get_object_to_buffer 出错
struct aos_status_s {
int code; // > 0 http code
char *error_code; // can't modify
char *error_msg; // can't modify
char *req_id; // can't modify
};
aos_status_s 结构反馈的错误信息:
code -992
error_code HttpIoError
error_msg Timeout
req_id 58EC0CD00731DD416E838728
aos_should_retry 函数的判断是否有BUG
应该判断 int code 的值,而不是判断 error_code
目前已知oss_request_options_create 和 aos_http_controller_create没有相应的资源释放函数。
[ 1%] Building C object CMakeFiles/oss_c_sdk.dir/oss_c_sdk/aos_status.o
/root/dbadir/20210329/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c: 在函数‘aos_should_retry’中:
/root/dbadir/20210329/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c:34:9: 警告:未使用的变量‘aos_error_code’ [-Wunused-variable]
int aos_error_code = 0;
^
/root/dbadir/20210329/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c: 在函数‘aos_status_parse_from_body’中:
/root/dbadir/20210329/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c:95:33: 错误:提领指向不完全类型的指针
node_content = code_node->child->value.opaque;
^
/root/dbadir/20210329/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c:101:36: 错误:提领指向不完全类型的指针
node_content = message_node->child->value.opaque;
^
make[2]: *** [CMakeFiles/oss_c_sdk.dir/oss_c_sdk/aos_status.o] 错误 1
make[1]: *** [CMakeFiles/oss_c_sdk.dir/all] 错误 2
make: *** [all] 错误 2
从官网上下载的c sdk 3.5 for windows,调用oss_resumable_upload_file或者oss_resumable_download_file接口时,传入的回掉函数只有2个参数分别表示已经处理的和全部的数据量。这种在多线程调用的时候,怎么区分哪个进度是哪个正在进行中的任务呢?
aos_string_t object;
int is_cname = 0;
oss_request_options_t *options = NULL;
aos_table_t *params = NULL;
aos_table_t *resp_headers = NULL;
aos_table_t *headers = NULL;
aos_status_t *s = NULL;
aos_string_t file;
aos_pool_t *p = NULL;
aos_string_t bucket;
aos_pool_create(&p, NULL);
options = oss_request_options_create(p);
initRequestOptions(options, is_cname);
headers = aos_table_make(p, 0);
aos_str_set(&bucket, bucketName.c_str());
aos_str_set(&object, objectName.c_str());
aos_str_set(&file, filePath.c_str());
if (resumable)
{
oss_resumable_clt_params_t *clt_params;
clt_params = oss_create_resumable_clt_params_content(p, partSize, threadNum, AOS_TRUE, 0);
s = oss_resumable_download_file(options, &bucket, &object, &file, headers, 0,
clt_params, downloadCallback, &resp_headers);
}
else
{
s = oss_do_get_object_to_file(options, &bucket, &object, headers, 0,
&file, downloadCallback, 0);
}
我上面的断点续传没写错吧。为什么会从头开始下载文件呢,我看了你的demo写的。哪里写错了吗
--interface INTERFACE Use network INTERFACE (or address)
Hi, after i installed latest oss c sdk, i found oss_resumable.h is not installed into /usr/local/include, which could cause my program fail to compile.
Then I checked the CMakeLists.txt , i found oss_resumable.h missed in INSTALL part, please add it
编译后出现这样的一句话怎么解决:
C:/Windows/System32/libcurl.dll: file not recognized: file format not recognized
oss_upload_part_t *part_arr = NULL;
... ...
// 这里存在溢出,应该为sizeof(oss_upload_part_t)。
part_arr = aos_palloc(parent_pool, OSS_MAX_PART_NUM * sizeof(oss_upload_part_t *));
... ...
oss_upload_part_t upload_part;
part_arr[part_index++] = upload_part;
请问aliyun-oss-c-sdk什么时候支持64位Windows库?
上传采用curl没有启用CURLOPT_TCP_KEEPALIVE,会导致应用占用大量端口
aliyun-oss-c-sdk版本:3.6.0
libcurl版本:7.63.0
问题:当我用aos_http_io_initialize()初始化网络和其他资源后,先后发起一个Content-Length为0的PUT请求(比如设置bucket的ACL)和一个GET请求,毋庸置疑,这两个HTTP请求会共用同一条TCP连接。发送第一个PUT请求时,虽然设置了”Content-Length:0“,并没有主动设置“Transfer-Encoding:chunked”(我查阅了代码),但是在发送的包里还是发现了“Transfer-Encoding:chunked”这个header,这导致服务器端忽略了Content-length,从而不能正确区分两个HTTP请求的边界,导致第二个请求失败。(当PUT请求的Content-length不为0时(比如分块上传),并没有发现“Transfer-Encoding”header)。
解决:我查阅了libcurl官方文档,发现对于“Transfer-Encoding”有这样的描述:
Enforcing chunked transfer-encoding
By making sure a request uses the custom header "Transfer-Encoding: chunked" when doing a non-GET HTTP operation, libcurl will switch over to "chunked" upload, even though the size of the data to upload might be known. By default, libcurl usually switches over to chunked upload automatically if the upload data size is unknown.
对于PUT请求,有这样的描述:
A parameter set to 1 tells the library to use HTTP PUT to transfer data. The data should be set with CURLOPT_READDATA and CURLOPT_INFILESIZE.
因此我在aos_transport.c的aos_curl_transport_setup()函数中添加了一句:
switch (t->req->method) {
case HTTP_HEAD:
curl_easy_setopt_safe(CURLOPT_NOBODY, 1);
break;
case HTTP_PUT:
curl_easy_setopt_safe(CURLOPT_UPLOAD, 1);
/* modify here */
curl_easy_setopt_safe(CURLOPT_INFILESIZE, t->req->body_len);
break;
case HTTP_POST:
curl_easy_setopt_safe(CURLOPT_POST, 1);
break;
case HTTP_DELETE:
curl_easy_setopt_safe(CURLOPT_CUSTOMREQUEST, "DELETE");
break;
default: // HTTP_GET
break;
}
现在它正常工作了,我觉得需要报告一下。
使用https://github.com/baiyubin/aliyun-oss-c-sdk-sample?spm=a2c4g.11186623.2.17.xrhV7M
这里面的例子运行多片上传命令,大概率返回400错误,请问是什么原因?
c sdk V3.5.0 断点续传下载时出现如题的错误,麻烦请问下是什么原因造成的
oss-c-sdk 使用的版本是 3.5.0的
code = CURLE_OPERATION_TIMEDOUT (28),实际上url地址是完全正确的
相同的代码,libcurl 换成7.30,上传图片就可以正常
~/oss_c_sdk/aliyun-oss-c-sdk-3.5.0$ make Scanning dependencies of target oss_c_sdk_static [ 1%] Building C object CMakeFiles/oss_c_sdk_static.dir/oss_c_sdk/aos_status.o oss_c_sdk/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c: In function ‘aos_should_retry’: oss_c_sdk/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c:34:9: warning: unused variable ‘aos_error_code’ [-Wunused-variable] int aos_error_code = 0; ^~~~~~~~~~~~~~ oss_c_sdk/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c: In function ‘aos_status_parse_from_body’: **oss_c_sdk/aliyun-oss-c-sdk-3.5.0/oss_c_sdk/aos_status.c:95:26: error: dereferencing pointer to incomplete type ‘mxml_node_t {aka struct _mxml_node_s}’ node_content = code_node->child->value.opaque; ^~** CMakeFiles/oss_c_sdk_static.dir/build.make:182: recipe for target 'CMakeFiles/oss_c_sdk_static.dir/oss_c_sdk/aos_status.o' failed make[2]: *** [CMakeFiles/oss_c_sdk_static.dir/oss_c_sdk/aos_status.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/oss_c_sdk_static.dir/all' failed make[1]: *** [CMakeFiles/oss_c_sdk_static.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2
版本如下:
apr-1.7.0
apr-util-1.6.1
mxml-3.1
aliyun-oss-c-sdk 从哪个版本开始支持ipv6
void put_object_from_file() 实现上传本地文件到OSS介绍中描述:
通过oss_put_object_from_file接口,并指定fliepath参数,可以实现上传一个本地文件到OSS。
实际上,api提供的oss_put_object_from_file接口,并没有这个path参数,该如何解决。
[问题描述在:官方问题描述链接
问题代码在:aliyun-oss-c-sdk / oss_c_sdk_sample / oss_put_object_sample.c
參考鏈接 https://help.aliyun.com/document_detail/90219.html?spm=a2c4g.11186623.6.1137.7fd42989fIdVD0 和 oss_c_sdk_test代碼,當設置 proxy 選項時:
void init_options(oss_request_options_t *options)
{
options->config = oss_config_create(options->pool);
/* 用char*类型的字符串初始化aos_string_t类型。*/
aos_str_set(&options->config->endpoint, endpoint);
aos_str_set(&options->config->access_key_id, access_key_id);
aos_str_set(&options->config->access_key_secret, access_key_secret);
aos_str_set(&options->config->proxy_host, proxy_host);
aos_str_set(&options->config->proxy_user, proxy_user);
aos_str_set(&options->config->proxy_passwd, proxy_passwd);
options->config->proxy_port = atoi(proxy_port);
/* 是否使用了CNAME。0表示不使用。*/
options->config->is_cname = 0;
/* 设置网络相关参数,比如超时时间等。*/
options->ctl = aos_http_controller_create(options->pool, 0);
options->ctl->options = aos_http_request_options_create(options->pool);
oss_config_resolve(options->pool, options->config, options->ctl);
options->ctl->options->verify_ssl = AOS_FALSE;
}
調用斷點續傳 api:
/* 断点续传。*/
clt_params = oss_create_resumable_clt_params_content(pool, 1024 * 100, 3, AOS_TRUE, NULL);
resp_status = oss_resumable_upload_file(oss_client_options, &bucket, &object, &file, headers, NULL, clt_params, NULL, &resp_headers, &resp_body);
將出現以下錯誤
aliyun-oss-c-sdk/oss_c_sdk/aos_transport.c:497 transport failure curl code:28 error:Timeout was reached
resumable upload failed
簡單看了下源代碼,猜測可能是沒有將 proxy 相關選項傳遞給 checkpoint content 的定義中。
Undefined symbols for architecture x86_64:
"_apr_array_make", referenced from:
_aos_fstack_create in aos_fstack.o
"_apr_array_pop", referenced from:
_aos_fstack_pop in aos_fstack.o
"_apr_array_push", referenced from:
_aos_fstack_push in aos_fstack.o
"_apr_atomic_inc32", referenced from:
_upload_part in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_atomic_read32", referenced from:
_upload_part in oss_resumable.o
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
_download_part_thread in oss_resumable.o
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_file_close", referenced from:
_aos_open_file_for_read in aos_buf.o
_aos_http_io_deinitialize in aos_http_io.o
_aos_transport_cleanup in aos_transport.o
_oss_get_file_info in oss_resumable.o
_oss_does_file_exist in oss_resumable.o
_oss_load_checkpoint in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
...
"_apr_file_flush", referenced from:
_oss_dump_checkpoint in oss_resumable.o
"_apr_file_info_get", referenced from:
_aos_open_file_for_read in aos_buf.o
_oss_get_file_info in oss_resumable.o
_oss_load_checkpoint in oss_resumable.o
"_apr_file_open", referenced from:
_aos_open_file_for_read in aos_buf.o
_aos_open_file_for_write in aos_buf.o
_aos_open_file_for_write_notrunc in aos_buf.o
_oss_get_file_info in oss_resumable.o
_oss_does_file_exist in oss_resumable.o
_oss_open_checkpoint_file in oss_resumable.o
_oss_load_checkpoint in oss_resumable.o
...
"_apr_file_read", referenced from:
_aos_read_http_body_file in aos_http_io.o
"_apr_file_read_full", referenced from:
_oss_load_checkpoint in oss_resumable.o
"_apr_file_remove", referenced from:
_oss_resumable_upload_file_with_cp in oss_resumable.o
_oss_resumable_download_file_internal in oss_resumable.o
_oss_temp_file_rename in oss_util.o
"_apr_file_rename", referenced from:
_oss_resumable_download_file_internal in oss_resumable.o
_oss_temp_file_rename in oss_util.o
"_apr_file_seek", referenced from:
_aos_open_file_for_range_read in aos_buf.o
_download_part in oss_resumable.o
"_apr_file_trunc", referenced from:
_oss_dump_checkpoint in oss_resumable.o
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_file_write", referenced from:
_aos_write_http_body_file in aos_http_io.o
_aos_log_print_default in aos_log.o
_oss_dump_checkpoint in oss_resumable.o
"_apr_initialize", referenced from:
_aos_http_io_initialize in aos_http_io.o
"_apr_is_empty_table", referenced from:
_aos_query_params_to_string in aos_util.o
_oss_get_canonicalized_headers in oss_auth.o
_oss_get_canonicalized_resource in oss_auth.o
_oss_get_canonicalized_params in oss_auth.o
"_apr_md5_final", referenced from:
_aos_md5 in aos_util.o
"_apr_md5_init", referenced from:
_aos_md5 in aos_util.o
"_apr_md5_update", referenced from:
_aos_md5 in aos_util.o
"_apr_os_thread_current", referenced from:
_aos_log_format_default in aos_log.o
"_apr_palloc", referenced from:
_aos_create_buf in aos_buf.o
_aos_buf_pack in aos_buf.o
_aos_buf_list_content in aos_buf.o
_aos_create_file_buf in aos_buf.o
_aos_buf_append_string in aos_buf.o
_aos_http_request_options_create in aos_http_io.o
_aos_http_controller_create in aos_http_io.o
...
"_apr_pool_create_ex", referenced from:
_aos_http_controller_create in aos_http_io.o
_aos_http_io_initialize in aos_http_io.o
_oss_delete_objects_by_prefix in oss_bucket.o
_oss_get_sorted_uploaded_part in oss_multipart.o
_oss_upload_file in oss_multipart.o
_oss_build_thread_params in oss_resumable.o
_oss_resumable_upload_file_without_cp in oss_resumable.o
...
"_apr_pool_destroy", referenced from:
_aos_http_io_deinitialize in aos_http_io.o
_oss_delete_objects_by_prefix in oss_bucket.o
_oss_get_sorted_uploaded_part in oss_multipart.o
_oss_upload_file in oss_multipart.o
_oss_destroy_thread_pool in oss_resumable.o
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
...
"_apr_psprintf", referenced from:
_aos_curl_default_write_callback in aos_transport.o
_aos_init_curl_headers in aos_transport.o
_aos_init_curl_url in aos_transport.o
_oss_sign_headers in oss_auth.o
_get_oss_request_signature in oss_auth.o
_oss_get_signed_url in oss_auth.o
_oss_get_rtmp_signed_url in oss_auth.o
...
"_apr_pstrdup", referenced from:
_aos_status_dup in aos_status.o
_aos_status_parse_from_body in aos_status.o
_aos_curl_http_transport_perform in aos_transport.o
_aos_curl_transport_setup in aos_transport.o
_aos_curl_transport_headers_done in aos_transport.o
_oss_delete_objects_by_prefix in oss_bucket.o
_oss_upload_file in oss_multipart.o
...
"_apr_pstrndup", referenced from:
_aos_pstrdup in aos_string.o
"_apr_queue_create", referenced from:
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_queue_pop", referenced from:
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_queue_push", referenced from:
_upload_part in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
_download_part_thread in oss_resumable.o
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_queue_size", referenced from:
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_queue_trypop", referenced from:
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
_download_part_thread in oss_resumable.o
"_apr_sha1_final", referenced from:
_HMAC_SHA1 in aos_util.o
"_apr_sha1_init", referenced from:
_HMAC_SHA1 in aos_util.o
"_apr_sha1_update", referenced from:
_HMAC_SHA1 in aos_util.o
"_apr_sleep", referenced from:
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
"_apr_snprintf", referenced from:
_aos_http_io_initialize in aos_http_io.o
_aos_log_format_default in aos_log.o
_aos_convert_to_gmt_time in aos_util.o
_aos_query_params_to_string in aos_util.o
_oss_get_canonicalized_headers in oss_auth.o
_oss_get_canonicalized_resource in oss_auth.o
_oss_sign_request in oss_auth.o
...
"_apr_stat", referenced from:
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_strerror", referenced from:
_aos_open_file_for_read in aos_buf.o
_aos_open_file_for_write in aos_buf.o
_aos_open_file_for_write_notrunc in aos_buf.o
_aos_read_http_body_file in aos_http_io.o
_aos_write_http_body_file in aos_http_io.o
_aos_http_io_initialize in aos_http_io.o
_aos_transport_cleanup in aos_transport.o
...
"_apr_strnatcasecmp", referenced from:
_aos_gnome_sort in aos_util.o
"_apr_strnatcmp", referenced from:
_is_oss_sub_resource in oss_auth.o
"_apr_table_add", referenced from:
_oss_put_bucket_acl in oss_bucket.o
_oss_get_bucket_acl in oss_bucket.o
_oss_get_bucket_location in oss_bucket.o
_oss_get_bucket_info in oss_bucket.o
_oss_get_bucket_stat in oss_bucket.o
_oss_get_bucket_referer in oss_bucket.o
_oss_get_bucket_storage_capacity in oss_bucket.o
...
"_apr_table_addn", referenced from:
_aos_curl_response_headers_parse in aos_transport.o
_oss_sign_headers in oss_auth.o
_oss_put_bucket_storage_capacity in oss_bucket.o
_oss_delete_objects in oss_bucket.o
"_apr_table_elts", referenced from:
_aos_init_curl_headers in aos_transport.o
_aos_query_params_to_string in aos_util.o
_oss_get_canonicalized_headers in oss_auth.o
_oss_get_canonicalized_resource in oss_auth.o
_oss_get_rtmp_signed_url in oss_auth.o
_oss_get_canonicalized_params in oss_auth.o
"_apr_table_get", referenced from:
_aos_curl_transport_headers_done in aos_transport.o
_oss_get_string_to_sign in oss_auth.o
_oss_get_canonicalized_headers in oss_auth.o
_oss_get_canonicalized_resource in oss_auth.o
_oss_sign_request in oss_auth.o
_oss_get_canonicalized_params in oss_auth.o
_oss_upload_file in oss_multipart.o
...
"_apr_table_make", referenced from:
_aos_http_request_create in aos_http_io.o
_aos_http_response_create in aos_http_io.o
_oss_upload_file in oss_multipart.o
_oss_put_symlink in oss_object.o
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
_aos_table_create_if_null in oss_util.o
...
"_apr_table_set", referenced from:
_oss_sign_request in oss_auth.o
_get_oss_request_signature in oss_auth.o
_oss_get_signed_url in oss_auth.o
_oss_get_rtmp_signed_url in oss_auth.o
_oss_create_bucket_with_params in oss_bucket.o
_oss_put_bucket_acl in oss_bucket.o
_oss_delete_objects in oss_bucket.o
...
"_apr_terminate", referenced from:
_aos_http_io_deinitialize in aos_http_io.o
"_apr_thread_create", referenced from:
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_thread_join", referenced from:
_oss_resumable_download_file_internal in oss_resumable.o
"_apr_thread_mutex_create", referenced from:
_aos_http_io_initialize in aos_http_io.o
"_apr_thread_mutex_destroy", referenced from:
_aos_http_io_deinitialize in aos_http_io.o
"_apr_thread_mutex_lock", referenced from:
_aos_request_get in aos_http_io.o
_request_release in aos_http_io.o
"_apr_thread_mutex_unlock", referenced from:
_aos_request_get in aos_http_io.o
_request_release in aos_http_io.o
"_apr_thread_pool_create", referenced from:
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
"_apr_thread_pool_push", referenced from:
_oss_resumable_upload_file_without_cp in oss_resumable.o
_oss_resumable_upload_file_with_cp in oss_resumable.o
"_apr_time_exp_gmt", referenced from:
_aos_get_gmt_str_time in aos_util.o
"_apr_time_exp_lt", referenced from:
_aos_log_format_default in aos_log.o
"_apr_time_now", referenced from:
_aos_log_format_default in aos_log.o
_aos_curl_default_header_callback in aos_transport.o
_aos_curl_default_write_callback in aos_transport.o
_aos_curl_http_transport_perform in aos_transport.o
_aos_get_gmt_str_time in aos_util.o
"_curl_easy_cleanup", referenced from:
_request_release in aos_http_io.o
_aos_http_io_deinitialize in aos_http_io.o
"_curl_easy_getinfo", referenced from:
_aos_curl_transport_headers_done in aos_transport.o
"_curl_easy_init", referenced from:
_aos_request_get in aos_http_io.o
"_curl_easy_perform", referenced from:
_aos_curl_http_transport_perform in aos_transport.o
"_curl_easy_reset", referenced from:
_aos_request_get in aos_http_io.o
"_curl_easy_setopt", referenced from:
_aos_curl_transport_setup in aos_transport.o
"_curl_easy_strerror", referenced from:
_aos_http_io_initialize in aos_http_io.o
_aos_curl_http_transport_perform in aos_transport.o
_aos_curl_transport_setup in aos_transport.o
_aos_curl_transport_headers_done in aos_transport.o
"_curl_global_init", referenced from:
_aos_http_io_initialize in aos_http_io.o
"_curl_slist_append", referenced from:
_aos_init_curl_headers in aos_transport.o
"_curl_slist_free_all", referenced from:
_aos_init_curl_headers in aos_transport.o
"_mxmlDelete", referenced from:
_aos_status_parse_from_body in aos_status.o
_oss_acl_parse_from_body in oss_xml.o
_oss_location_parse_from_body in oss_xml.o
_oss_storage_capacity_parse_from_body in oss_xml.o
_oss_logging_parse_from_body in oss_xml.o
_oss_list_objects_parse_from_body in oss_xml.o
_oss_list_buckets_parse_from_body in oss_xml.o
...
"_mxmlFindElement", referenced from:
_aos_status_parse_from_body in aos_status.o
_get_xmlnode_value in oss_xml.o
_oss_logging_parse_from_body in oss_xml.o
_oss_list_objects_owner_parse in oss_xml.o
_oss_list_objects_content_parse in oss_xml.o
_oss_list_objects_contents_parse in oss_xml.o
_oss_list_objects_prefix_parse in oss_xml.o
...
"_mxmlLoadString", referenced from:
_aos_parse_xml_body in aos_util.o
_oss_checkpoint_parse_from_body in oss_xml.o
"_mxmlNewElement", referenced from:
_build_complete_multipart_upload_xml in oss_xml.o
_build_bucket_logging_xml in oss_xml.o
_build_lifecycle_xml in oss_xml.o
_build_referer_config_xml in oss_xml.o
_build_cors_rule_xml in oss_xml.o
_build_website_config_xml in oss_xml.o
_build_bucket_storage_class_xml in oss_xml.o
...
"_mxmlNewText", referenced from:
_build_complete_multipart_upload_xml in oss_xml.o
_build_bucket_logging_xml in oss_xml.o
_build_lifecycle_xml in oss_xml.o
_build_referer_config_xml in oss_xml.o
_build_cors_rule_xml in oss_xml.o
_build_website_config_xml in oss_xml.o
_build_bucket_storage_class_xml in oss_xml.o
...
"_mxmlNewXML", referenced from:
_build_complete_multipart_upload_xml in oss_xml.o
_build_bucket_logging_xml in oss_xml.o
_build_lifecycle_xml in oss_xml.o
_build_referer_config_xml in oss_xml.o
_build_cors_rule_xml in oss_xml.o
_build_website_config_xml in oss_xml.o
_build_bucket_storage_class_xml in oss_xml.o
...
"_mxmlSaveString", referenced from:
_new_xml_buff in oss_xml.o
"_mxml_opaque_cb", referenced from:
_aos_parse_xml_body in aos_util.o
_oss_checkpoint_parse_from_body in oss_xml.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [build/lib/liboss_c_sdk.3.0.0.dylib] Error 1
make[1]: *** [CMakeFiles/oss_c_sdk.dir/all] Error 2
make: *** [all] Error 2
API中的URL params用的是apr_table_t,如oss_do_put_object_from_buffer(),oss_do_get_object_to_buffer()等。apr_table_get/set不区分key的大小写,如果外部传入的params的key与oss定义key的有大小写不敏感匹配(如EXPires)时,在对params table进行set时可能覆盖原value,并无法改写key的大小写。这可能导致一些不符合预期的访问。
crc64 code uses macro ONCE() to do dynamic initialization, and ONCE() is defined as
/* Run the init() function exactly once. If pthread.h is not included, then
this macro will use a simple static state variable for the purpose, which is
not thread-safe. The init function must be of the type void init(void). */
#ifdef PTHREAD_ONCE_INIT
# define ONCE(init) \
do { \
static pthread_once_t once = PTHREAD_ONCE_INIT; \
pthread_once(&once, init); \
} while (0)
#else
# define ONCE(init) \
do { \
static volatile int once = 1; \
if (once) { \
if (once++ == 1) { \
init(); \
once = 0; \
} \
else \
while (once) \
; \
} \
} while (0)
#endif
So it's meant to be defined to use pthread_once() when pthread is available. But aos_crc64.c doesn't include pthread.h from any header files, so even if we have APR_HAVE_PTHREAD_H defined as 1 (from apr.h), pthread.h is not included either. And this may result in infinite loop in multi-thread environments.
I'll submit a PR for this issue.
那rust可以用c的sdk吗
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.