日志打印BUG

This commit is contained in:
zhangchengwei
2018-10-19 17:39:24 +08:00
committed by zhengchao
parent 1563e1abba
commit 46db35c9a5
3 changed files with 8 additions and 9 deletions

View File

@@ -770,6 +770,8 @@ struct tango_cache_instance *tango_cache_instance_new(struct event_base* evbase,
instance = (struct tango_cache_instance *)malloc(sizeof(struct tango_cache_instance));
memset(instance, 0, sizeof(struct tango_cache_instance));
instance->runtime_log = runtimelog;
instance->evbase = evbase;
if(load_local_configure(instance, profile_path, section))
{
@@ -782,10 +784,7 @@ struct tango_cache_instance *tango_cache_instance_new(struct event_base* evbase,
return NULL;
}
instance->evbase = evbase;
instance->multi_hd = curl_multi_init();
instance->runtime_log = runtimelog;
curl_multi_setopt(instance->multi_hd, CURLMOPT_PIPELINING, CURLPIPE_HTTP1 | CURLPIPE_MULTIPLEX);
curl_multi_setopt(instance->multi_hd, CURLMOPT_MAX_HOST_CONNECTIONS, instance->max_cnn_host);
curl_multi_setopt(instance->multi_hd, CURLMOPT_SOCKETFUNCTION, curl_socket_function_cb);

View File

@@ -7,7 +7,7 @@
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)
#define DBG_CACHE(fmt, args...) do{printf("%s():%d, " fmt, __FUNCTION__, __LINE__, ##args);}while(0)
#else
#define DBG_CACHE(msg...)
#endif

View File

@@ -138,7 +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);
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);
DBG_CACHE("state: %d, length: %lu, key: %s\n", ctx->put.state, ctx->put.upload_length, ctx->object_key);
return 1;
}
@@ -197,7 +197,7 @@ int curl_get_minio_uploadID(struct tango_cache_ctx *ctx)
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
assert(rc==CURLM_OK);
DBG_CACHE("curl_get_minio_uploadID, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
DBG_CACHE("state: %d, key: %s\n", ctx->put.state, ctx->object_key);
return 1;
}
@@ -295,7 +295,7 @@ bool cache_kick_combine_minio(struct tango_cache_ctx *ctx)
rc = curl_multi_add_handle(ctx->instance->multi_hd, ctx->curl);
assert(rc==CURLM_OK);
DBG_CACHE("cache_kick_combine_minio, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
DBG_CACHE("state: %d, key: %s\n", ctx->put.state, ctx->object_key);
return true;
}
@@ -357,7 +357,7 @@ int cache_kick_upload_minio_end(struct tango_cache_ctx *ctx)
{
int ret = 0;
DBG_CACHE("cache_kick_upload_minio_end, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
DBG_CACHE("state: %d, key: %s, curl %s NULL\n", ctx->put.state, ctx->object_key, (ctx->curl==NULL)?"is":"is not");
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)
{
@@ -416,7 +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)
{
DBG_CACHE("tango_cache_curl_put_done, state: %d, key: %s\n", ctx->put.state, ctx->object_key);
DBG_CACHE("state: %d, key: %s\n", ctx->put.state, ctx->object_key);
switch(ctx->put.state)
{
case PUT_STATE_WAIT_START: