1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/otherbackends
Simon Tatham 0fe41294e6 New API for plug_closing() with a custom type enum.
Passing an operating-system-specific error code to plug_closing(),
such as errno or GetLastError(), was always a bit weird, given that it
generally had to be handled by cross-platform receiving code in
backends. I had the platform.h implementations #define any error
values that the cross-platform code would have to handle specially,
but that's still not a great system, because it also doesn't leave
freedom to invent error representations of my own that don't
correspond to any OS code. (For example, the ones I just removed from
proxy.h.)

So now, the OS error code is gone from the plug_closing API, and in
its place is a custom enumeration of closure types: normal, error, and
the special case BROKEN_PIPE which is the only OS error code we have
so far needed to handle specially. (All others just mean 'abandon the
connection and print the textual message'.)

Having already centralised the handling of OS error codes in the
previous commit, we've now got a convenient place to add any further
type codes for errors needing special handling: each of Unix
plug_closing_errno(), Windows plug_closing_system_error(), and Windows
plug_closing_winsock_error() can easily grow extra special cases if
need be, and each one will only have to live in one place.
2021-11-06 14:48:26 +00:00
..
CMakeLists.txt Move other backends into a subdirectory. 2021-04-22 18:24:15 +01:00
raw.c New API for plug_closing() with a custom type enum. 2021-11-06 14:48:26 +00:00
rlogin.c New API for plug_closing() with a custom type enum. 2021-11-06 14:48:26 +00:00
supdup.c New API for plug_closing() with a custom type enum. 2021-11-06 14:48:26 +00:00
telnet.c New API for plug_closing() with a custom type enum. 2021-11-06 14:48:26 +00:00
testback.c Lowercase version of BackendVtable's displayname. 2021-10-24 09:59:05 +01:00