projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a .cvsignore for the Unix subdir
[u/mdw/putty]
/
psftp.c
diff --git
a/psftp.c
b/psftp.c
index
f3f4c5b
..
e585732
100644
(file)
--- a/
psftp.c
+++ b/
psftp.c
@@
-32,6
+32,8
@@
static int do_sftp_init(void);
*/
char *pwd, *homedir;
*/
char *pwd, *homedir;
+static Backend *back;
+static void *backhandle;
/* ----------------------------------------------------------------------
* Higher-level helper functions used in commands.
/* ----------------------------------------------------------------------
* Higher-level helper functions used in commands.
@@
-1470,7
+1472,7
@@
void modalfatalbox(char *fmt, ...)
cleanup_exit(1);
}
cleanup_exit(1);
}
-void connection_fatal(char *fmt, ...)
+void connection_fatal(
void *frontend,
char *fmt, ...)
{
char str[0x100]; /* Make the size big enough */
va_list ap;
{
char str[0x100]; /* Make the size big enough */
va_list ap;
@@
-1484,7
+1486,7
@@
void connection_fatal(char *fmt, ...)
cleanup_exit(1);
}
cleanup_exit(1);
}
-void ldisc_send(char *buf, int len, int interactive)
+void ldisc_send(
void *handle,
char *buf, int len, int interactive)
{
/*
* This is only here because of the calls to ldisc_send(NULL,
{
/*
* This is only here because of the calls to ldisc_send(NULL,
@@
-1610,7
+1612,7
@@
int sftp_recvdata(char *buf, int len)
}
int sftp_senddata(char *buf, int len)
{
}
int sftp_senddata(char *buf, int len)
{
- back->send((unsigned char *) buf, len);
+ back->send(
backhandle,
(unsigned char *) buf, len);
return 1;
}
return 1;
}
@@
-1621,7
+1623,7
@@
static void ssh_sftp_init(void)
{
if (sftp_ssh_socket == INVALID_SOCKET)
return;
{
if (sftp_ssh_socket == INVALID_SOCKET)
return;
- while (!back->sendok()) {
+ while (!back->sendok(
backhandle
)) {
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(sftp_ssh_socket, &readfds);
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(sftp_ssh_socket, &readfds);
@@
-1822,11
+1824,13
@@
static int psftp_connect(char *userhost, char *user, int portnumber)
back = &ssh_backend;
back = &ssh_backend;
- err = back->init(NULL, cfg.host, cfg.port, &realhost, 0);
+ err = back->init(NULL,
&backhandle,
cfg.host, cfg.port, &realhost, 0);
if (err != NULL) {
fprintf(stderr, "ssh_init: %s\n", err);
return 1;
}
if (err != NULL) {
fprintf(stderr, "ssh_init: %s\n", err);
return 1;
}
+ logctx = log_init(NULL);
+ back->provide_logctx(backhandle, logctx);
ssh_sftp_init();
if (verbose && realhost != NULL)
printf("Connected to %s\n", realhost);
ssh_sftp_init();
if (verbose && realhost != NULL)
printf("Connected to %s\n", realhost);
@@
-1921,9
+1925,9
@@
int main(int argc, char *argv[])
do_sftp(mode, modeflags, batchfile);
do_sftp(mode, modeflags, batchfile);
- if (back != NULL && back->socket() != NULL) {
+ if (back != NULL && back->socket(
backhandle
) != NULL) {
char ch;
char ch;
- back->special(TS_EOF);
+ back->special(
backhandle,
TS_EOF);
sftp_recvdata(&ch, 1);
}
WSACleanup();
sftp_recvdata(&ch, 1);
}
WSACleanup();