mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-24 05:32:21 +00:00
MINOR: hpack: use ist2bin() to copy header names in hpack_encode_header()
memcpy() tends to be overkill to copy short strings, better use ist's naive functions for this. This shows a consistent 1.2% performance gain with h2load.
This commit is contained in:
parent
1526f1942c
commit
ac73ae0b83
@ -116,9 +116,8 @@ int hpack_encode_header(struct buffer *out, const struct ist n,
|
||||
out->area[len++] = 0x5c; // literal with indexing -- name="content-length" (idx 28)
|
||||
else if (len_to_bytes(n.len) && len + 1 + len_to_bytes(n.len) + n.len <= size) {
|
||||
out->area[len++] = 0x00; /* literal without indexing -- new name */
|
||||
|
||||
len = hpack_encode_len(out->area, len, n.len);
|
||||
memcpy(out->area + len, n.ptr, n.len);
|
||||
ist2bin(out->area + len, n);
|
||||
len += n.len;
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user