RFC 7230, section 4.1 - Chunked Transfer Coding */
| 457 | |
| 458 | /* RFC 7230, section 4.1 - Chunked Transfer Coding */ |
| 459 | static int HttpClient_GetChunkLength(const cc_string* line) { |
| 460 | int length = 0, i, part; |
| 461 | |
| 462 | for (i = 0; i < line->length; i++) |
| 463 | { |
| 464 | char c = line->buffer[i]; |
| 465 | /* RFC 7230, section 4.1.1 - Chunk Extensions */ |
| 466 | if (c == ';') break; |
| 467 | |
| 468 | part = PackedCol_DeHex(c); |
| 469 | if (part == -1) return -1; |
| 470 | length = (length << 4) | part; |
| 471 | } |
| 472 | return length; |
| 473 | } |
| 474 | |
| 475 | /* https://httpwg.org/specs/rfc7230.html */ |
| 476 | static cc_result HttpClient_Process(struct HttpClientState* state, char* buffer, int total) { |
no test coverage detected