Skip to content

Commit

Permalink
ircd::client: Set some client::request values immediately after head …
Browse files Browse the repository at this point in the history
…parse.
  • Loading branch information
jevolk committed Mar 11, 2019
1 parent ffc6527 commit 5b31913
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
11 changes: 11 additions & 0 deletions ircd/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 6 additions & 8 deletions ircd/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 5b31913

Please sign in to comment.