mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 16:34:13 +01:00
ircd::http: Remove request parser helper from here.
This commit is contained in:
parent
cd0dc9a0ff
commit
1f7ed51f3b
2 changed files with 0 additions and 27 deletions
|
@ -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.
|
||||
|
|
21
ircd/http.cc
21
ircd/http.cc
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue