Curl_chunker: shrink the struct

... by removing a field, converting the hex index into a byte and
rearranging the order. Cuts it down from 48 bytes to 32 on x86_64.

Closes #6527
This commit is contained in:
Daniel Stenberg 2021-01-25 17:42:59 +01:00
parent a705f28bb3
commit 5ad377718d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 11 additions and 15 deletions

View file

@ -92,7 +92,6 @@ void Curl_httpchunk_init(struct Curl_easy *data)
struct connectdata *conn = data->conn;
struct Curl_chunker *chunk = &conn->chunk;
chunk->hexindex = 0; /* start at 0 */
chunk->dataleft = 0; /* no data left yet! */
chunk->state = CHUNK_HEX; /* we get hex first! */
Curl_dyn_init(&conn->trailer, DYN_H1_TRAILER);
}
@ -309,7 +308,7 @@ CHUNKcode Curl_httpchunk_read(struct Curl_easy *data,
/* Record the length of any data left in the end of the buffer
even if there's no more chunks to read */
ch->dataleft = curlx_sotouz(length);
ch->datasize = curlx_sotouz(length);
return CHUNKE_STOP; /* return stop */
}