| 372 | } |
| 373 | |
| 374 | int Response::parse_status_line(Parser &p) { |
| 375 | p.skip_string("HTTP/"); |
| 376 | m_version = p.extract_until_char(' '); |
| 377 | if (m_version.size() >= 6) |
| 378 | LOG_ERROR_RETURN(0, -1, "invalid scheme"); |
| 379 | auto code = p.extract_integer(); |
| 380 | if (code <= 0 || code >= 1000) |
| 381 | LOG_ERROR_RETURN(0, -1, "invalid status code ", code); |
| 382 | m_status_code = (uint16_t)code; |
| 383 | p.skip_chars(' '); |
| 384 | m_status_message = p.extract_until_char('\r'); |
| 385 | p.skip_chars('\n'); |
| 386 | return 0; |
| 387 | } |
| 388 | |
| 389 | int Response::set_result(int code, std::string_view reason) { |
| 390 | char* buf = m_buf; |
nothing calls this directly
no test coverage detected