1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

handle_{got,sent}data: separate length and error params.

Now we pass an error code in a separate dedicated parameter, instead
of overloading the length parameter so that a negative value means an
error code. This enables length to become unsigned without causing
trouble.
This commit is contained in:
Simon Tatham
2019-02-06 20:36:11 +00:00
parent a742abae27
commit f60fe670ad
5 changed files with 29 additions and 34 deletions

View File

@ -603,8 +603,10 @@ void init_ucs(Conf *, struct unicode_data *);
#define HANDLE_FLAG_IGNOREEOF 2
#define HANDLE_FLAG_UNITBUFFER 4
struct handle;
typedef int (*handle_inputfn_t)(struct handle *h, const void *data, int len);
typedef void (*handle_outputfn_t)(struct handle *h, int new_backlog);
typedef int (*handle_inputfn_t)(
struct handle *h, const void *data, int len, int err);
typedef void (*handle_outputfn_t)(
struct handle *h, int new_backlog, int err);
struct handle *handle_input_new(HANDLE handle, handle_inputfn_t gotdata,
void *privdata, int flags);
struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata,