From 204dfab4ca2d12f97172c12f05155671a3d299e9 Mon Sep 17 00:00:00 2001 From: liuleimin_hw Date: Sun, 6 Jul 2025 07:42:18 +0000 Subject: [PATCH 1/3] =?UTF-8?q?Http=5FResponseCallback=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0length=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuleimin_hw --- network/netstack/net_http/net_http_type.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/network/netstack/net_http/net_http_type.h b/network/netstack/net_http/net_http_type.h index f02019792b4..9f4a0f547d9 100644 --- a/network/netstack/net_http/net_http_type.h +++ b/network/netstack/net_http/net_http_type.h @@ -132,7 +132,7 @@ typedef enum Http_ResponseCode { /** @brief The request has been accepted but has not been processed completely. */ OH_HTTP_ACCEPTED = 202, /** @brief Unauthorized information. The request was successful. */ - OH_HTTP_NOT_AUTHORITATIVE = 203, + OH_HTTP_NON_AUTHORITATIVE_INFO = 203, /** @brief No content. The server successfully processed, but did not return content. */ OH_HTTP_NO_CONTENT = 204, /** @brief Reset the content. */ @@ -458,8 +458,6 @@ typedef struct Http_RequestOptions { Http_ClientCert *clientCert; /** Set the DNS resolution for the https server. */ const char *dnsOverHttps; - /** Maximum number of bytes in a response message. */ - uint32_t maxLimit; /** The address family can be specified when target domain name is resolved, see {@link Http_AddressFamilyType}. */ Http_AddressFamilyType addressFamily; } Http_RequestOptions; @@ -516,10 +514,10 @@ typedef void (*Http_ResponseCallback)(struct Http_Response *response, uint32_t e * @brief Callback function that is invoked when a response body is received. * * @param data Response body. - * @return size_t the length of response body. + * @param size_t the length of response body. * @since 20 */ -typedef size_t (*Http_OnDataReceiveCallback)(const char *data); +typedef void (*Http_OnDataReceiveCallback)(const char *data, size_t length); /** * @brief Callback function invoked during request/response data transmission. -- Gitee From b24e2dfa3b6f5d9eb8e338febfc5193d7cc60a27 Mon Sep 17 00:00:00 2001 From: liuleimin_hw Date: Sun, 6 Jul 2025 07:46:50 +0000 Subject: [PATCH 2/3] update network/netstack/net_http/net_http_type.h. Signed-off-by: liuleimin_hw --- network/netstack/net_http/net_http_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netstack/net_http/net_http_type.h b/network/netstack/net_http/net_http_type.h index 9f4a0f547d9..dc412bd7796 100644 --- a/network/netstack/net_http/net_http_type.h +++ b/network/netstack/net_http/net_http_type.h @@ -514,7 +514,7 @@ typedef void (*Http_ResponseCallback)(struct Http_Response *response, uint32_t e * @brief Callback function that is invoked when a response body is received. * * @param data Response body. - * @param size_t the length of response body. + * @param length Length of response body. * @since 20 */ typedef void (*Http_OnDataReceiveCallback)(const char *data, size_t length); -- Gitee From 5891f7b31830e0d42584ed88beeee7a795008b15 Mon Sep 17 00:00:00 2001 From: liuleimin_hw Date: Sun, 6 Jul 2025 10:40:05 +0000 Subject: [PATCH 3/3] update network/netstack/net_http/net_http_type.h. Signed-off-by: liuleimin_hw --- network/netstack/net_http/net_http_type.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/network/netstack/net_http/net_http_type.h b/network/netstack/net_http/net_http_type.h index dc412bd7796..612d0b9235d 100644 --- a/network/netstack/net_http/net_http_type.h +++ b/network/netstack/net_http/net_http_type.h @@ -140,7 +140,7 @@ typedef enum Http_ResponseCode { /** @brief Partial content. The server successfully processed some GET requests. */ OH_HTTP_PARTIAL = 206, /** @brief Multiple options. */ - OH_HTTP_MULT_CHOICE = 300, + OH_HTTP_MULTI_CHOICE = 300, /** * @brief Permanently move. The requested resource has been permanently moved to a new URI, * and the returned information will include the new URI. The browser will automatically redirect to the new URI. @@ -186,11 +186,11 @@ typedef enum Http_ResponseCode { /** @brief The request was rejected because the requested entity was too large for the server to process. */ OH_HTTP_ENTITY_TOO_LARGE = 413, /** @brief The requested URI is too long (usually a URL) and the server cannot process it. */ - OH_HTTP_REQ_TOO_LONG = 414, + OH_HTTP_REQUEST_TOO_LONG = 414, /** @brief The server is unable to process the requested format. */ OH_HTTP_UNSUPPORTED_TYPE = 415, /** @brief Requested Range not satisfiable. */ - OH_HTTP_RANGE_NOT_SATISFIABLE = 416, + OH_HTTP_RANGE_NOT_MET = 416, /** @brief Internal server error, unable to complete the request. */ OH_HTTP_INTERNAL_ERROR = 500, /** @brief The server does not support the requested functionality and cannot complete the request. */ @@ -537,7 +537,7 @@ typedef void (*Http_OnProgressCallback)(uint64_t totalSize, uint64_t transferred typedef void (*Http_OnHeaderReceiveCallback)(Http_Headers *headers); /** - * @brief Empty callback function for requested DataEnd or Canceled event callback + * @brief Empty callback function for requested DataEnd or Canceled event callback. * * @since 20 */ -- Gitee