mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-18 11:31:00 -05:00
Give BPPs a Frontend, so they can do their own logging.
The sshverstring quasi-frontend is passed a Frontend pointer at setup time, so that it can generate Event Log entries containing the local and remote version strings and the results of remote bug detection. I'm promoting that field of sshverstring to a field of the public BPP structure, so now all BPPs have the right to talk directly to the frontend if they want to. This means I can move all the log messages of the form 'Initialised so-and-so cipher/MAC/compression' down into the BPPs themselves, where they can live exactly alongside the actual initialisation of those primitives. It also means BPPs will be able to log interesting things they detect at any point in the packet stream, which is about to come in useful for another purpose.
This commit is contained in:
@ -33,11 +33,12 @@ static const struct BinaryPacketProtocolVtable ssh2_bare_bpp_vtable = {
|
||||
ssh2_bpp_queue_disconnect, /* in sshcommon.c */
|
||||
};
|
||||
|
||||
BinaryPacketProtocol *ssh2_bare_bpp_new(void)
|
||||
BinaryPacketProtocol *ssh2_bare_bpp_new(Frontend *frontend)
|
||||
{
|
||||
struct ssh2_bare_bpp_state *s = snew(struct ssh2_bare_bpp_state);
|
||||
memset(s, 0, sizeof(*s));
|
||||
s->bpp.vt = &ssh2_bare_bpp_vtable;
|
||||
s->bpp.frontend = frontend;
|
||||
ssh_bpp_common_setup(&s->bpp);
|
||||
return &s->bpp;
|
||||
}
|
||||
|
Reference in New Issue
Block a user