1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Jacob points out that I introduced a bug in PSFTP when I did the

timing shakeup: just running `psftp' caused the net/stdin select
loop (on both Unix and Windows) to get confused at the lack of any
network connection and give up immediately. Should now be fixed.

[originally from svn r4993]
This commit is contained in:
Simon Tatham
2004-12-16 19:15:38 +00:00
parent 69303f2d3e
commit f1585f8f46
4 changed files with 20 additions and 10 deletions

View File

@ -462,7 +462,7 @@ char *dir_file_cat(char *dir, char *file)
/*
* Be told what socket we're supposed to be using.
*/
static SOCKET sftp_ssh_socket;
static SOCKET sftp_ssh_socket = INVALID_SOCKET;
static HANDLE netevent = NULL;
char *do_select(SOCKET skt, int startup)
{
@ -676,7 +676,7 @@ static DWORD WINAPI command_read_thread(void *param)
return 0;
}
char *ssh_sftp_get_cmdline(char *prompt)
char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
{
int ret;
struct command_read_ctx actx, *ctx = &actx;
@ -685,7 +685,8 @@ char *ssh_sftp_get_cmdline(char *prompt)
fputs(prompt, stdout);
fflush(stdout);
if (sftp_ssh_socket == INVALID_SOCKET || p_WSAEventSelect == NULL) {
if ((sftp_ssh_socket == INVALID_SOCKET && no_fds_ok) ||
p_WSAEventSelect == NULL) {
return fgetline(stdin); /* very simple */
}