cache添加宏定义CACHE_DEBUG_SWITCH打印debug信息
This commit is contained in:
6
cache/src/tango_cache_tools.h
vendored
6
cache/src/tango_cache_tools.h
vendored
@@ -6,6 +6,12 @@
|
|||||||
#define MESA_HANDLE_RUNTIME_LOGV2(handle, lv, fmt, args...) \
|
#define MESA_HANDLE_RUNTIME_LOGV2(handle, lv, fmt, args...) \
|
||||||
MESA_handle_runtime_log((handle), (lv), "TANGO_CACHE", "%s:%d, " fmt, __FILE__, __LINE__, ##args)
|
MESA_handle_runtime_log((handle), (lv), "TANGO_CACHE", "%s:%d, " fmt, __FILE__, __LINE__, ##args)
|
||||||
|
|
||||||
|
#ifdef CACHE_DEBUG_SWITCH
|
||||||
|
#define DBG_CACHE(msg...) do{printf(msg);}while(0)
|
||||||
|
#else
|
||||||
|
#define DBG_CACHE(msg...)
|
||||||
|
#endif
|
||||||
|
|
||||||
int Base64_EncodeBlock(const unsigned char *in, int inl, unsigned char *out);
|
int Base64_EncodeBlock(const unsigned char *in, int inl, unsigned char *out);
|
||||||
int Base64_DecodeBlock(const unsigned char *in, int inl, unsigned char *out, int outsize);
|
int Base64_DecodeBlock(const unsigned char *in, int inl, unsigned char *out, int outsize);
|
||||||
|
|
||||||
|
|||||||
5
cache/src/tango_cache_transfer.cpp
vendored
5
cache/src/tango_cache_transfer.cpp
vendored
@@ -138,6 +138,7 @@ static int http_put_bodypart_request_evbuf(struct tango_cache_ctx *ctx, bool ful
|
|||||||
|
|
||||||
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
|
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
|
||||||
assert(rc==CURLM_OK);
|
assert(rc==CURLM_OK);
|
||||||
|
DBG_CACHE("http_put_bodypart_request_evbuf, state: %d, length: %lu, key: %s\n", ctx->put.state, ctx->put.upload_length, ctx->object_key);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,6 +197,7 @@ int curl_get_minio_uploadID(struct tango_cache_ctx *ctx)
|
|||||||
|
|
||||||
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
|
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
|
||||||
assert(rc==CURLM_OK);
|
assert(rc==CURLM_OK);
|
||||||
|
DBG_CACHE("curl_get_minio_uploadID, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,6 +295,7 @@ bool cache_kick_combine_minio(struct tango_cache_ctx *ctx)
|
|||||||
|
|
||||||
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
|
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
|
||||||
assert(rc==CURLM_OK);
|
assert(rc==CURLM_OK);
|
||||||
|
DBG_CACHE("cache_kick_combine_minio, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,6 +357,7 @@ int cache_kick_upload_minio_end(struct tango_cache_ctx *ctx)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
DBG_CACHE("cache_kick_upload_minio_end, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
|
||||||
ctx->put.close_state = true;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رգ<D8B1><D5A3>ڲ<EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٹر<D9B9>
|
ctx->put.close_state = true;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رգ<D8B1><D5A3>ڲ<EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٹر<D9B9>
|
||||||
if(ctx->fail_state)
|
if(ctx->fail_state)
|
||||||
{
|
{
|
||||||
@@ -412,6 +416,7 @@ int cache_kick_upload_minio_end(struct tango_cache_ctx *ctx)
|
|||||||
|
|
||||||
void tango_cache_curl_put_done(struct tango_cache_ctx *ctx, CURLcode res, long res_code)
|
void tango_cache_curl_put_done(struct tango_cache_ctx *ctx, CURLcode res, long res_code)
|
||||||
{
|
{
|
||||||
|
DBG_CACHE("tango_cache_curl_put_done, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
|
||||||
switch(ctx->put.state)
|
switch(ctx->put.state)
|
||||||
{
|
{
|
||||||
case PUT_STATE_WAIT_START:
|
case PUT_STATE_WAIT_START:
|
||||||
|
|||||||
Reference in New Issue
Block a user