mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
ircd::server: Fix loghead() failure conditions.
This commit is contained in:
parent
84d4ca485b
commit
0f184cd449
1 changed files with 10 additions and 3 deletions
|
@ -340,13 +340,20 @@ ircd::server::loghead(const mutable_buffer &buf,
|
||||||
const request &request)
|
const request &request)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(empty(request.in.head))
|
if(empty(request.out.head))
|
||||||
return "<no header>";
|
return "<no head>";
|
||||||
|
|
||||||
parse::buffer pb{request.out.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);
|
pc.read += size(request.out.head);
|
||||||
const http::request::head head{pc};
|
const http::request::head head{pc};
|
||||||
|
if(!head.method || !head.path)
|
||||||
|
return "<no head data>";
|
||||||
|
|
||||||
return fmt::sprintf
|
return fmt::sprintf
|
||||||
{
|
{
|
||||||
buf, "%s %s", head.method, head.path
|
buf, "%s %s", head.method, head.path
|
||||||
|
|
Loading…
Reference in a new issue