上传时输出对象的路径

This commit is contained in:
zhangchengwei
2018-09-28 15:16:28 +08:00
committed by zhengchao
parent ce3e46b6cf
commit b145b2c3bb
9 changed files with 37 additions and 33 deletions

View File

@@ -57,9 +57,9 @@ struct tango_cache_result *cache_evbase_read_result(void *promise_result)
return tango_cache_read_result(promise_result);
}
const char *cache_evbase_get_object_key(struct cache_evbase_ctx *ctx_asyn)
void cache_evbase_get_object_path(const struct cache_evbase_ctx *ctx_asyn, char *path, size_t pathsize)
{
return tango_cache_get_object_key(ctx_asyn->ctx);
tango_cache_get_object_path(ctx_asyn->ctx, path, pathsize);
}
static int create_notification_pipe(evutil_socket_t sv[2])
@@ -344,7 +344,7 @@ struct cache_evbase_ctx *cache_evbase_update_start(struct cache_evbase_instance
}
int cache_evbase_upload_once_data(struct cache_evbase_instance *instance, struct future* future,
enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size, struct tango_cache_meta *meta, char *objectkey, size_t keysize)
enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size, struct tango_cache_meta *meta, char *path, size_t pathsize)
{
struct cache_evbase_ctx *ctx_asyn;
struct tango_cache_ctx *ctx;
@@ -355,9 +355,9 @@ int cache_evbase_upload_once_data(struct cache_evbase_instance *instance, struct
{
return -1;
}
if(objectkey != NULL)
if(path != NULL)
{
snprintf(objectkey, keysize, "%s", ctx->object_key);
snprintf(path, pathsize, "http://%s/%s/%s", ctx->hostaddr, instance->instance->bucketname, ctx->object_key);
}
ctx_asyn = (struct cache_evbase_ctx *)calloc(1, sizeof(struct cache_evbase_ctx));
@@ -390,7 +390,7 @@ int cache_evbase_upload_once_data(struct cache_evbase_instance *instance, struct
}
int cache_evbase_upload_once_evbuf(struct cache_evbase_instance *instance, struct future* future,
struct evbuffer *evbuf, struct tango_cache_meta *meta, char *objectkey, size_t keysize)
struct evbuffer *evbuf, struct tango_cache_meta *meta, char *path, size_t pathsize)
{
struct cache_evbase_ctx *ctx_asyn;
struct tango_cache_ctx *ctx;
@@ -401,9 +401,9 @@ int cache_evbase_upload_once_evbuf(struct cache_evbase_instance *instance, struc
{
return -1;
}
if(objectkey != NULL)
if(path != NULL)
{
snprintf(objectkey, keysize, "%s", ctx->object_key);
snprintf(path, pathsize, "http://%s/%s/%s", ctx->hostaddr, instance->instance->bucketname, ctx->object_key);
}
ctx_asyn = (struct cache_evbase_ctx *)calloc(1, sizeof(struct cache_evbase_ctx));