From 192687648c49ac517d050b57c8e3ae8cd73ee023 Mon Sep 17 00:00:00 2001 From: liuxianliang Date: Thu, 10 Jun 2021 20:30:21 +0800 Subject: [PATCH] [update] code format --- inc/webclient.h | 2 +- src/webclient.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/inc/webclient.h b/inc/webclient.h index 6bd4f1f..5942530 100644 --- a/inc/webclient.h +++ b/inc/webclient.h @@ -115,7 +115,7 @@ int webclient_shard_head_function(struct webclient_session *session, const char /* send HTTP Range parameter, shard download */ int webclient_shard_position_function(struct webclient_session *session, const char *URI, int start, int length, int mem_size); -char *webclient_register_shard_position_function(struct webclient_session *session, int (*handle_function)(char *buffer, int size)); +int *webclient_register_shard_position_function(struct webclient_session *session, int (*handle_function)(char *buffer, int size)); /* send HTTP POST request */ int webclient_post(struct webclient_session *session, const char *URI, const void *post_data, size_t data_len); diff --git a/src/webclient.c b/src/webclient.c index cb9b46b..dac2bca 100644 --- a/src/webclient.c +++ b/src/webclient.c @@ -973,11 +973,11 @@ int webclient_get(struct webclient_session *session, const char *URI) * * @return the pointer */ -char *webclient_register_shard_position_function(struct webclient_session *session, int (*handle_function)(char *buffer, int size)) +int *webclient_register_shard_position_function(struct webclient_session *session, int (*handle_function)(char *buffer, int size)) { session->handle_function = handle_function; - return (char *)session->handle_function; + return (int *)session->handle_function; } /** @@ -985,7 +985,7 @@ char *webclient_register_shard_position_function(struct webclient_session *sessi * * @param session webclient session * @param URI input server URI address - * @param the buffer size that you alloc + * @param length the length of point * * @return <0: send GET request failed * >0: response http status code @@ -1136,7 +1136,7 @@ int webclient_shard_position_function(struct webclient_session *session, const c } /* receive the incoming data */ - data_len = webclient_response(session, &buffer, (size_t *)RT_NULL); + data_len = webclient_response(session, (void **)&buffer, (size_t *)RT_NULL); if(data_len > 0) { start_position += mem_size;