MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / parse_status_line

Method parse_status_line

net/http/message.cpp:374–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374int 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
389int Response::set_result(int code, std::string_view reason) {
390 char* buf = m_buf;

Callers

nothing calls this directly

Calls 5

skip_stringMethod · 0.80
extract_until_charMethod · 0.80
extract_integerMethod · 0.80
skip_charsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected