[tarantool-patches] Re: [PATCH v1 1/1] http: fix httpc auto-managed headers

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Mar 7 17:07:29 MSK 2019


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 *





More information about the Tarantool-patches mailing list