diff --git a/ircd/client.cc b/ircd/client.cc index d57f2599d..7fa17d46e 100644 --- a/ircd/client.cc +++ b/ircd/client.cc @@ -770,6 +770,17 @@ try content_consumed }; + // Sets values in this->client::request based on everything we know from + // the head for this scope. This gets updated again in the resource:: + // unit for their scope with more data including the content. + const scope_restore request + { + this->request, resource::request + { + head, string_view{} // no content considered yet + } + }; + bool ret { resource_request(head) diff --git a/ircd/resource.cc b/ircd/resource.cc index 3e9c68ea6..a7641038e 100644 --- a/ircd/resource.cc +++ b/ircd/resource.cc @@ -391,20 +391,18 @@ try }; } - client.request = resource::request - { - head, content - }; - // We take the extra step here to clear the assignment to client.request // when this request stack has finished for two reasons: // - It allows other ctxs to peep at the client::list to see what this // client/ctx/request is currently working on with some more safety. // - It prevents an easy source for stale refs wrt the longpoll thing. - const unwind clear_request{[&client] + const scope_restore client_request { - client.request = {}; - }}; + client.request, resource::request + { + head, content + } + }; const auto pathparm {