1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Move TempSeat creation/destruction into Interactor.

Previously, SshProxy dealt with creating a TempSeat to wrap the one it
was borrowing from its client, and then each client in turn dealt with
detecting when it had had its seat borrowed and finishing up with the
TempSeat. The latter involved a lot of code duplication; the former
didn't involve code duplication _yet_ (since SshProxy was the only
thing doing this job), but would have once we started wanting to do
interactive password prompting for other types of network proxy.

Now all of that functionality is centralised into two new Interactor
helper functions: interactor_borrow_seat and interactor_return_seat.
This commit is contained in:
Simon Tatham
2021-10-30 17:45:38 +01:00
parent f00c72cc2a
commit 7460594433
8 changed files with 56 additions and 56 deletions

View File

@ -706,6 +706,8 @@ static inline Seat *interactor_get_seat(Interactor *itr)
static inline void interactor_set_seat(Interactor *itr, Seat *seat)
{ itr->vt->set_seat(itr, seat); }
Seat *interactor_borrow_seat(Interactor *itr);
void interactor_return_seat(Interactor *itr);
InteractionReadySeat interactor_announce(Interactor *itr);
/* Interactors that are Backends will find this helper function useful
@ -1468,9 +1470,9 @@ Seat *tempseat_new(Seat *real);
bool is_tempseat(Seat *seat);
Seat *tempseat_get_real(Seat *seat);
/* Called by the backend once the proxy connection has finished
* setting up (or failed), to pass on any buffered stuff to the real
* seat. */
/* Called by interactor_return_seat once the proxy connection has
* finished setting up (or failed), to pass on any buffered stuff to
* the real seat. */
void tempseat_flush(Seat *ts);
/* Frees a TempSeat, without flushing anything it has buffered. (Call