mirror of
https://github.com/curl/curl.git
synced 2026-08-26 11:23:35 +03:00
http: improve response header handling, save cpu cycles
Saving some cpu cycles in http response header processing: - pass the length of the header line along - use string constant sizeof() instead of strlen() - check line length if prefix is possible - switch on first header char to limit checks Closes #13143
This commit is contained in:
parent
6bd4ca0ef6
commit
522ea5420f
5 changed files with 394 additions and 334 deletions
|
|
@ -171,7 +171,7 @@ static int hyper_each_header(void *userdata,
|
|||
len = Curl_dyn_len(&data->state.headerb);
|
||||
headp = Curl_dyn_ptr(&data->state.headerb);
|
||||
|
||||
result = Curl_http_header(data, data->conn, headp);
|
||||
result = Curl_http_header(data, data->conn, headp, len);
|
||||
if(result) {
|
||||
data->state.hresult = result;
|
||||
return HYPER_ITER_BREAK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue