mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::http: Elide the strlcat() for user header generation.
This commit is contained in:
parent
0399ddf3e3
commit
5335371b1a
1 changed files with 5 additions and 7 deletions
12
ircd/http.cc
12
ircd/http.cc
|
@ -344,17 +344,15 @@ ircd::http::request::request(const string_view &host,
|
|||
content.size())
|
||||
};
|
||||
|
||||
char user_headers[printed_size(headers) + 2 + 1]; auto user_headers_len
|
||||
char user_headers[printed_size(headers) + 2]; auto user_headers_len
|
||||
{
|
||||
print(user_headers, sizeof(user_headers), headers)
|
||||
};
|
||||
|
||||
static const auto &terminator
|
||||
{
|
||||
"\r\n"
|
||||
};
|
||||
|
||||
user_headers_len = strlcat(user_headers, terminator, sizeof(user_headers));
|
||||
assert(user_headers_len + 3 == sizeof(user_headers));
|
||||
user_headers[user_headers_len++] = '\r';
|
||||
user_headers[user_headers_len++] = '\n';
|
||||
//user_headers[user_headers_len++] = '\0';
|
||||
|
||||
const ilist<const_buffer> vector
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue