0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 04:08:54 +02:00

ircd::http: Remove request parser helper from here.

This commit is contained in:
Jason Volk 2018-01-11 18:43:06 -08:00
parent cd0dc9a0ff
commit 1f7ed51f3b
2 changed files with 0 additions and 27 deletions

View file

@ -271,12 +271,6 @@ struct ircd::http::request
const string_view &content_type = {},
const vector_view<const header> & = {},
const bool &termination = true);
// recv
request(parse::capstan &,
content *const &,
const proffer & = nullptr,
const headers::closure & = {});
};
/// Represents an HTTP request head. This is only for receiving requests.

View file

@ -234,27 +234,6 @@ struct ircd::http::parser
}
const ircd::http::parser;
ircd::http::request::request(parse::capstan &pc,
content *const &c,
const proffer &proffer,
const headers::closure &headers_closure)
{
const head h{pc, headers_closure};
const char *const content_mark(pc.parsed);
const unwind discard_unused_content{[&pc, &h, &content_mark]
{
const size_t consumed(pc.parsed - content_mark);
const size_t remain(h.content_length - consumed);
http::content{pc, remain, content::discard};
}};
if(proffer)
proffer(h);
if(c)
*c = content{pc, h};
}
/// Compose a request. This prints an HTTP head into the buffer. No real IO is
/// done here. After composing into the buffer, the user can then drive the
/// socket by sending the header and the content as specified.