From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CDDAB28DC2 for ; Thu, 7 Mar 2019 09:07:31 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BZqQZtNp6QSs for ; Thu, 7 Mar 2019 09:07:31 -0500 (EST) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8BB6D28DB6 for ; Thu, 7 Mar 2019 09:07:31 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH v1 1/1] http: fix httpc auto-managed headers References: <9099f8a339c278e3a5dac683923d13c7ee470ce9.1550761676.git.kshcherbatov@tarantool.org> <80130a1b-84ad-5f90-9422-95bb0a1e67cb@tarantool.org> <998b800b-acc1-f0c8-1fd3-322d0c04f657@tarantool.org> From: Vladislav Shpilevoy Message-ID: <53210653-ccfc-c94f-fdb7-b932d5a9db9a@tarantool.org> Date: Thu, 7 Mar 2019 17:07:29 +0300 MIME-Version: 1.0 In-Reply-To: <998b800b-acc1-f0c8-1fd3-322d0c04f657@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Kirill Shcherbatov , tarantool-patches@freelists.org Hi! Thanks for the patch. Please, apply the diff below and then LGTM. diff --git a/src/httpc.c b/src/httpc.c index 96740f950..060cacb48 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -113,9 +113,7 @@ httpc_request_new(struct httpc_env *env) mempool_free(&env->req_pool, req); return NULL; } - ibuf_create(&req->body, &cord()->slabc, 1); - return req; } @@ -178,14 +176,13 @@ httpc_request_delete(struct httpc_request *req) * Update bitmask of the http request headers that httpc may set * automatically. In case of reserved pattern is found in header, * routine sets corresponding bit in auto_headers_mask. - * Returns -1 when header is reserved and it's bit is already set - * in auto_headers_mask; 0 otherwise, - * @param auto_headers_mask The bitmask of httpc-auto-managed - * headers to pointer. - * @param header The HTTP header string. - * @retval 0 When specified header is not auto-managed or when - * corresponding bit was not set in auto_headers_mask. - * @retval -1 otherwise. + * @param auto_headers_mask A bitmask of httpc-auto-managed + * headers to pointer. + * @param header A HTTP header string. + * + * @retval 0 Specified header is not auto-managed or + * corresponding bit was not set in auto_headers_mask. + * @retval -1 Otherwise. */ static int httpc_set_header_bit(uint8_t *auto_headers_mask, const char *header) @@ -196,7 +193,7 @@ httpc_set_header_bit(uint8_t *auto_headers_mask, const char *header) * to be formated with "%s: %s" pattern, so direct size * verification is redundant. */ - struct { + static struct { const char *name; int len; } managed_headers[] = { diff --git a/src/httpc.h b/src/httpc.h index dc18ffb69..361af57e1 100644 --- a/src/httpc.h +++ b/src/httpc.h @@ -120,7 +120,7 @@ struct httpc_request { /** * @brief Create a new HTTP request - * @param env - HTTP client environment. + * @param env HTTP client environment. * @return a new HTTP request object */ struct httpc_request *