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:
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)
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue