Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>,
	Tarantool MailList <tarantool-patches@freelists.org>
Subject: Re: [tarantool-patches] Re: [PATCH v1 1/1] http: fix httpc auto-managed headers
Date: Thu, 7 Mar 2019 17:07:04 +0300	[thread overview]
Message-ID: <607fe6de-8db7-d379-a2f7-888f602796b5@tarantool.org> (raw)
In-Reply-To: <20190307135135.dner6r66szejw6lx@esperanza>

>> +	/*
>> +	 * The sequence of managed headers must be sorted to
>> +	 * stop scan when strcasecmp < 0. The header is expected
>> +	 * to be formated with "%s: %s" pattern, so direct size
>> +	 * verification is redundant.
>> +	 */
>> +	struct {
>> +		const char *name;
>> +		int len;
>> +	} managed_headers[] = {
>> +		{"Accept: ", sizeof("Accept: ") - 1},
>> +		{"Connection: ", sizeof("Connection: ") - 1},
>> +		{"Content-Length: ", sizeof("Content-Length: ") - 1},
>> +		{"Keep-Alive: ", sizeof("Keep-Alive: ") - 1},
> 
>  - A space after a colon (:) isn't mandatory according to the http
>    protocol, e.g. "content-length:10" is a valid header.
All headers are formated by server earlier, so this is acceptable:
	if (httpc_set_header(req, "%s: %s",
					     lua_tostring(L, -2),
					     lua_tostring(L, -1)) < 0) {
				httpc_request_delete(req);
				return luaT_error(L);
			}

  reply	other threads:[~2019-03-07 14:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 15:09 [tarantool-patches] " Kirill Shcherbatov
2019-02-22  7:39 ` [tarantool-patches] " Kirill Shcherbatov
2019-02-25  7:52   ` Kirill Shcherbatov
2019-02-25 14:17     ` Vladislav Shpilevoy
2019-02-25 15:21       ` Kirill Shcherbatov
2019-03-07 13:51         ` Vladimir Davydov
2019-03-07 14:07           ` Kirill Shcherbatov [this message]
2019-03-07 14:32             ` Vladimir Davydov
2019-03-07 14:48           ` Kirill Shcherbatov
2019-03-07 14:53             ` Vladimir Davydov
2019-03-11  9:23               ` [tarantool-patches] Re: [PATCH v2 " Kirill Shcherbatov
2019-03-11 10:02                 ` Vladimir Davydov
2019-03-11 15:57                   ` Kirill Shcherbatov
2019-03-12  8:54                     ` Vladimir Davydov
2019-03-07 14:07         ` [tarantool-patches] Re: [PATCH v1 " Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=607fe6de-8db7-d379-a2f7-888f602796b5@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] Re: [PATCH v1 1/1] http: fix httpc auto-managed headers' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox