diff --git a/cos_c_sdk/cos_object.c b/cos_c_sdk/cos_object.c index 176a359..1a22488 100644 --- a/cos_c_sdk/cos_object.c +++ b/cos_c_sdk/cos_object.c @@ -986,6 +986,10 @@ int cos_gen_presigned_url(const cos_request_options_t *options, http_method_e method, cos_string_t *presigned_url) { + if (object == NULL || object->len == 0){ + cos_str_set(presigned_url, "ObjectName does not support empty, please check!"); + return COSE_UNKNOWN_ERROR; + } cos_string_t signstr; int res; cos_http_request_t *req = NULL; @@ -1059,6 +1063,10 @@ int cos_gen_presigned_url_safe(const cos_request_options_t *options, int sign_host, cos_string_t *presigned_url) { + if (object == NULL || object->len == 0){ + cos_str_set(presigned_url, "ObjectName does not support empty, please check!"); + return COSE_UNKNOWN_ERROR; + } cos_string_t signstr; int res; cos_http_request_t *req = NULL; diff --git a/cos_c_sdk/cos_sys_define.h b/cos_c_sdk/cos_sys_define.h index ffa6182..a7901bf 100644 --- a/cos_c_sdk/cos_sys_define.h +++ b/cos_c_sdk/cos_sys_define.h @@ -132,7 +132,7 @@ typedef apr_array_header_t cos_array_header_t; #define CR (char) 13 #define CRLF "\x0d\x0a" -#define COS_VERSION "5.0.16" +#define COS_VERSION "5.0.17" #define COS_VER "cos-sdk-c/" COS_VERSION #define COS_HTTP_PREFIX "http://" diff --git a/cos_c_sdk/cos_sys_util.c b/cos_c_sdk/cos_sys_util.c index 70505b1..f1a7213 100644 --- a/cos_c_sdk/cos_sys_util.c +++ b/cos_c_sdk/cos_sys_util.c @@ -12,7 +12,7 @@ static const char *g_s_mon[] = { }; static const char g_s_gmt_format[] = "%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT"; -static int retry_change_domin_config = 1; +static int retry_change_domin_config = COS_FALSE; static cos_table_t *g_sign_header_table = NULL; static cos_pool_t *g_table_pool = NULL;