diff --git a/cache/include/tango_cache_client.h b/cache/include/tango_cache_client.h index 1592b8e..c551e8f 100644 --- a/cache/include/tango_cache_client.h +++ b/cache/include/tango_cache_client.h @@ -150,6 +150,7 @@ struct tango_cache_ctx *tango_cache_update_start(struct tango_cache_instance *in int tango_cache_update_frag_data(struct tango_cache_ctx *ctx, const char *data, size_t size); int tango_cache_update_frag_evbuf(struct tango_cache_ctx *ctx, enum EVBUFFER_COPY_WAY way, struct evbuffer *evbuf); void tango_cache_update_end(struct tango_cache_ctx *ctx); +//调用cancel后不会产生结果回调,认作传输失败 void tango_cache_update_cancel(struct tango_cache_ctx *ctx); //获取对象key值;当CACHE_OBJECT_KEY_HASH_SWITCH=1开启对URL/文件名哈希时有用 diff --git a/cache/src/tango_cache_client.cpp b/cache/src/tango_cache_client.cpp index 46eac9e..c04bb37 100644 --- a/cache/src/tango_cache_client.cpp +++ b/cache/src/tango_cache_client.cpp @@ -268,6 +268,7 @@ void tango_cache_update_cancel(struct tango_cache_ctx *ctx) ctx->curl = NULL; } tango_cache_set_fail_state(ctx, CACHE_UPDATE_CANCELED); + //已经产生分段上传ID时,调用cancel删除 if(ctx->put.uploadID!=NULL && cache_cancel_upload_minio(ctx)) { ctx->put.state = PUT_STATE_CANCEL; diff --git a/cache/test/tango_cache_test.c b/cache/test/tango_cache_test.cpp similarity index 100% rename from cache/test/tango_cache_test.c rename to cache/test/tango_cache_test.cpp