HomePhabricator
Diffusion Comm 2c269eb01013

[Tunnelbroker] refactor initializing session to make it possible to send a…

Description

[Tunnelbroker] refactor initializing session to make it possible to send a response to the client on session creation failure

Summary:
This refactor is to make D9595 possible.
The intention is to fix outgoing's ownership issue when session creation fails (send forces outgoing to be mutable).
Doesn't look like a very optimal pattern, but not sure if this can be improved are is there a more graceful way to handle this - if anyone has any suggestions I am happy to change this 😄

Creating separate diff to make it easier for reviewers, actual usage is in D9595.

Depends on D9593

Test Plan: Tunnelbroker tests (most important are test_tunnelbroker_invalid_auth and test_tunnelbroker_valid_auth).

Reviewers: michal, bartek, varun, jon

Reviewed By: michal, bartek

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9594