1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 06:38:37 -05:00

Modify the FIXME into a calculated risk. I don't like this, but I

don't like the thought of having to try to fix it either,
particularly when I can't tell whether it'll work or not without
reproducing the (probably phantom) problem. Gah. I wish WinSock
would give better documentation of possible error returns.

[originally from svn r1260]
This commit is contained in:
Simon Tatham 2001-09-09 15:41:58 +00:00
parent 7bb4a9f5f0
commit b9d9b4951f

View File

@ -745,7 +745,6 @@ void try_send(Actual_Socket s)
urgentflag = 0; urgentflag = 0;
bufchain_prefix(&s->output_data, &data, &len); bufchain_prefix(&s->output_data, &data, &len);
} }
nsent = send(s->s, data, len, urgentflag); nsent = send(s->s, data, len, urgentflag);
noise_ultralight(nsent); noise_ultralight(nsent);
if (nsent <= 0) { if (nsent <= 0) {
@ -765,17 +764,30 @@ void try_send(Actual_Socket s)
} else if (nsent == 0 || } else if (nsent == 0 ||
err == WSAECONNABORTED || err == WSAECONNRESET) { err == WSAECONNABORTED || err == WSAECONNRESET) {
/* /*
* FIXME. This will have to be done better when we * ASSUMPTION:
* start managing multiple sockets (e.g. SSH port *
* forwarding), because if we get CONNRESET while * I'm assuming here that if a TCP connection is
* trying to write a particular forwarded socket * reset or aborted once established, we will be
* then it isn't necessarily the end of the world. * notified by a select event rather than a
* Ideally I'd like to pass the error code back to * CONNABORTED or CONNRESET from send(). In other
* somewhere the next select_result() will see it, * words, I'm assuming CONNABORTED and CONNRESET
* but that might be hard. Perhaps I should pass it * don't come back from a _nonblocking_ send(),
* back to be queued in the Windows front end bit. * because the local side doesn't know they've
* happened until it waits for a response to its
* TCP segment - so the error will arrive
* asynchronously.
*
* If I'm wrong, this will be a really nasty case,
* because we can't necessarily call plug_closing()
* without having to make half the SSH code
* reentrant; so instead we'll have to schedule a
* call to plug_closing() for some suitable future
* time.
*/ */
fatalbox(winsock_error_string(err)); fatalbox("SERIOUS NETWORK INTERNAL ERROR: %s\n"
"Please report this immediately to "
"<putty@projects.tartarus.org>.",
winsock_error_string(err));
} else { } else {
fatalbox(winsock_error_string(err)); fatalbox(winsock_error_string(err));
} }