伏神_个人页

个人头像照片 伏神
0
3
0

个人介绍

暂无个人介绍

擅长的技术

获得更多能力
通用技术能力:

暂时未有相关通用技术能力~

云产品技术能力:

暂时未有相关云产品技术能力~

阿里云技能认证

详细说明
暂无更多信息
正在加载, 请稍后...
暂无更多信息
  • 回答了问题 2017-03-21

    是官方C SDK的bug还是OSS服务器的bug????

    Re是官方C SDK的bug还是OSS服务器的bug???? C SDK没有问题,是我自己没有用对,我仔细看了sdk的源码实现,是我不该直接把?symlink放到对象名字后面作为文件名传入,应该把symlink作为请求参数传入,这样就不会对?编码了; 我把封装好的创建符号链接代码和使用示例代码传上来供需要的同学参考。 const char BUCKET_NAME[] = 'xxxxxx';const char OSS_SYMLINK_TAEGET[] = 'x-oss-symlink-target';const char OSS_REQ_PARAM_SYMLINK[] = 'symlink';aos_status_t *oss_put_symlink(const oss_request_options_t *options,        const aos_string_t *bucket,        const aos_string_t *symlink_object,        const aos_string_t *target_object,        aos_table_t *headers,        aos_table_t **resp_headers){        aos_status_t *s = NULL;        aos_http_request_t *req = NULL;        aos_http_response_t *resp = NULL;        aos_table_t *query_params = NULL;        char* targname = NULL;        headers = aos_table_create_if_null(options, headers, 0);        query_params = aos_table_create_if_null(options, query_params, 0);        apr_table_add(query_params, OSS_REQ_PARAM_SYMLINK, ''); // symlink request key without value        targname = aos_pstrdup(options->pool, target_object);        apr_table_add(headers, OSS_SYMLINK_TAEGET, targname);        oss_init_object_request(options, bucket, symlink_object, HTTP_PUT,                &req, query_params, headers, NULL, 0, &resp);        s = oss_process_request(options, req, resp);        oss_fill_read_response_header(resp, resp_headers);        return s;}aos_status_t *oss_get_symlink(const oss_request_options_t *options,        const aos_string_t *bucket,        const aos_string_t *symlink_object,        aos_table_t *headers,        aos_table_t **resp_headers){        aos_status_t *s = NULL;        aos_http_request_t *req = NULL;        aos_http_response_t *resp = NULL;        aos_table_t *query_params = NULL;        headers = aos_table_create_if_null(options, headers, 0);        query_params = aos_table_create_if_null(options, query_params, 0);        apr_table_add(query_params, OSS_REQ_PARAM_SYMLINK, ''); // symlink request key without value        oss_init_object_request(options, bucket, symlink_object, HTTP_GET,                &req, query_params, headers, NULL, 0, &resp);        s = oss_process_request(options, req, resp);        oss_fill_read_response_header(resp, resp_headers);        return s;}//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void put_object_symlink(){        aos_pool_t *p = NULL;        aos_string_t bucket;        aos_string_t symlink_object;        aos_string_t target_object;        int is_cname = 0;        aos_table_t *headers = NULL;        aos_table_t *resp_headers = NULL;        oss_request_options_t *options = NULL;        aos_list_t buffer;        aos_buf_t *content = NULL;        char *str = '';        aos_status_t *s = NULL;        char* pbuf = NULL;        aos_pool_create(&p, NULL);        options = oss_request_options_create(p);        init_sample_request_options(options, is_cname);        headers = aos_table_make(p, 1);        apr_table_set(headers, 'x-oss-meta-author', 'oss');        aos_str_set(&bucket, BUCKET_NAME);        aos_str_set(&symlink_object, 'obj_link');// 符号链接名        aos_str_set(&target_object, 'obj_name'); // 目标对象名        aos_list_init(&buffer);        content = aos_buf_pack(options->pool, str, strlen(str));        aos_list_add_tail(&content->node, &buffer);        s = oss_put_symlink(options, &bucket, &symlink_object, &target_object, headers, &resp_headers);        if (aos_status_is_ok(s)) {                printf('put object symlink succeeded\n');        }        else {                printf('put object symlink failed\n');        }        aos_pool_destroy(p);}void get_object_symlink(){        aos_pool_t *p = NULL;        aos_string_t bucket;        aos_string_t symlink_object;        int is_cname = 0;        aos_table_t *headers = NULL;        aos_table_t *resp_headers = NULL;        oss_request_options_t *options = NULL;        aos_list_t buffer;        aos_buf_t *content = NULL;        char *str = '';        aos_status_t *s = NULL;        char* pLink = NULL;        aos_pool_create(&p, NULL);        options = oss_request_options_create(p);        init_sample_request_options(options, is_cname);        headers = aos_table_make(p, 1);        apr_table_set(headers, 'x-oss-meta-author', 'oss');        aos_str_set(&bucket, BUCKET_NAME);        aos_str_set(&symlink_object, 'obj_link');        aos_list_init(&buffer);        content = aos_buf_pack(options->pool, str, strlen(str));        aos_list_add_tail(&content->node, &buffer);        s = oss_get_symlink(options, &bucket, &symlink_object, headers, &resp_headers);        if (aos_status_is_ok(s))        {                printf('get object symlink succeeded\n');                pLink = apr_table_get(resp_headers, 'x-oss-symlink-target');        }        else        {                printf('get object symlink failed\n');        }        aos_pool_destroy(p);}
    踩0 评论0
  • 提交了问题 2017-03-17

    是官方C SDK的bug还是OSS服务器的bug????

  • 回答了问题 2017-03-17

    oss c sdk如何设置通信时和CURL相关的一些参数

    Reoss c sdk如何设置通信时和CURL相关的一些参数 虽然已经过去很久了,还是回一下楼上的问题,方便以后的同学参考。 这个问题应该是由于依赖库引起的问题,oss sdk里面的libarp等几个库的debug版本需要有vc9运行库的debug版本支持,如果没有安装vs2008只单独安装微软的vc9运行库,系统里面只会有vc9运行库的release版而没有debug版 如何分析问题: 1.可以用dependency walker参考dll的依赖关系 2.可以在windows系统日志中参考应用程序的错误日志,也能看到相应的库错误信息
    踩0 评论0
正在加载, 请稍后...
滑动查看更多
正在加载, 请稍后...
暂无更多信息