MCPcopy Create free account
hub / github.com/bcndev/bytecoin / process_ready_header

Method process_ready_header

src/http/ResponseParser.cpp:169–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169bool ResponseParser::process_ready_header(ResponseHeader &req) {
170 if (lowcase.name == "content-length") {
171 try {
172 req.content_length = common::integer_cast<decltype(req.content_length)>(lowcase.value); // std::stoull
173 req.headers.pop_back();
174 return true;
175 } catch (const std::exception &) {
176 }
177 return false;
178 }
179 if (lowcase.name == "connection") {
180 if (lowcase.value == "close") {
181 req.keep_alive = false;
182 req.headers.pop_back();
183 return true;
184 }
185 if (lowcase.value == "keep-alive") {
186 req.keep_alive = true;
187 req.headers.pop_back();
188 return true;
189 }
190 return false;
191 }
192 return true;
193}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected