0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::server: Fix loghead() failure conditions.

This commit is contained in:
Jason Volk 2019-03-25 18:43:00 -07:00
parent 84d4ca485b
commit 0f184cd449

View file

@ -340,13 +340,20 @@ ircd::server::loghead(const mutable_buffer &buf,
const request &request)
try
{
if(empty(request.in.head))
return "<no header>";
if(empty(request.out.head))
return "<no head>";
parse::buffer pb{request.out.head};
parse::capstan pc{pb};
parse::capstan pc{pb, [](char *&read, char *stop)
{
read = stop;
}};
pc.read += size(request.out.head);
const http::request::head head{pc};
if(!head.method || !head.path)
return "<no head data>";
return fmt::sprintf
{
buf, "%s %s", head.method, head.path