mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Merge branch 'pre-0.64'
This commit is contained in:
commit
23208779e7
9
psftp.c
9
psftp.c
@ -668,21 +668,19 @@ int sftp_put_file(char *fname, char *outfname, int recurse, int restart)
|
||||
if (restart) {
|
||||
char decbuf[30];
|
||||
struct fxp_attrs attrs;
|
||||
int ret;
|
||||
|
||||
req = fxp_fstat_send(fh);
|
||||
pktin = sftp_wait_for_reply(req);
|
||||
ret = fxp_fstat_recv(pktin, req, &attrs);
|
||||
|
||||
if (!ret) {
|
||||
close_rfile(file);
|
||||
printf("read size of %s: %s\n", outfname, fxp_error());
|
||||
return 0;
|
||||
goto cleanup;
|
||||
}
|
||||
if (!(attrs.flags & SSH_FILEXFER_ATTR_SIZE)) {
|
||||
close_rfile(file);
|
||||
printf("read size of %s: size was not given\n", outfname);
|
||||
return 0;
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
offset = attrs.size;
|
||||
uint64_decimal(offset, decbuf);
|
||||
@ -735,6 +733,7 @@ int sftp_put_file(char *fname, char *outfname, int recurse, int restart)
|
||||
|
||||
xfer_cleanup(xfer);
|
||||
|
||||
cleanup:
|
||||
req = fxp_close_send(fh);
|
||||
pktin = sftp_wait_for_reply(req);
|
||||
fxp_close_recv(pktin, req);
|
||||
|
@ -780,7 +780,7 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i
|
||||
{
|
||||
int s;
|
||||
#ifndef NO_IPV6
|
||||
struct addrinfo hints, *ai;
|
||||
struct addrinfo hints, *ai = NULL;
|
||||
char portstr[6];
|
||||
#endif
|
||||
union sockaddr_union u;
|
||||
@ -926,6 +926,12 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i
|
||||
}
|
||||
|
||||
retcode = bind(s, &addr->sa, addrlen);
|
||||
|
||||
#ifndef NO_IPV6
|
||||
if (ai)
|
||||
freeaddrinfo(ai);
|
||||
#endif
|
||||
|
||||
if (retcode < 0) {
|
||||
close(s);
|
||||
ret->error = strerror(errno);
|
||||
|
@ -696,6 +696,7 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
|
||||
int ret;
|
||||
struct command_read_ctx actx, *ctx = &actx;
|
||||
DWORD threadid;
|
||||
HANDLE hThread;
|
||||
|
||||
fputs(prompt, stdout);
|
||||
fflush(stdout);
|
||||
@ -712,8 +713,9 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
|
||||
ctx->event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
ctx->line = NULL;
|
||||
|
||||
if (!CreateThread(NULL, 0, command_read_thread,
|
||||
ctx, 0, &threadid)) {
|
||||
hThread = CreateThread(NULL, 0, command_read_thread, ctx, 0, &threadid);
|
||||
if (!hThread) {
|
||||
CloseHandle(ctx->event);
|
||||
fprintf(stderr, "Unable to create command input thread\n");
|
||||
cleanup_exit(1);
|
||||
}
|
||||
@ -725,6 +727,9 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
|
||||
assert(ret >= 0);
|
||||
} while (ret == 0);
|
||||
|
||||
CloseHandle(hThread);
|
||||
CloseHandle(ctx->event);
|
||||
|
||||
return ctx->line;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user