pscp.c when I did the big revamp in r9279: I assumed that in any SCP
connection we would be the first to send EOF, but in fact this isn't
true - doing downloads with old-SCP, EOF is initiated by the server,
so we were spuriously reporting an error for 'unexpected' EOF when
everything had gone fine. Thanks to Nathan Phelan for the report.
git-svn-id: svn://svn.tartarus.org/sgt/putty@10016
cda61777-01e9-0310-a592-
d414129be87e
static int main_cmd_is_sftp = 0;
static int fallback_cmd_is_sftp = 0;
static int using_sftp = 0;
static int main_cmd_is_sftp = 0;
static int fallback_cmd_is_sftp = 0;
static int using_sftp = 0;
+static int uploading = 0;
static Backend *back;
static void *backhandle;
static Backend *back;
static void *backhandle;
int from_backend_eof(void *frontend)
{
/*
int from_backend_eof(void *frontend)
{
/*
- * We expect to be the party deciding when to close the
+ * We usually expect to be the party deciding when to close the
* connection, so if we see EOF before we sent it ourselves, we
* connection, so if we see EOF before we sent it ourselves, we
+ * should panic. The exception is if we're using old-style scp and
+ * downloading rather than uploading.
+ if ((using_sftp || uploading) && !sent_eof) {
connection_fatal(frontend,
"Received unexpected end-of-file from server");
}
connection_fatal(frontend,
"Received unexpected end-of-file from server");
}
char *cmd;
int i, wc_type;
char *cmd;
int i, wc_type;
targ = argv[argc - 1];
/* Separate host from filename */
targ = argv[argc - 1];
/* Separate host from filename */
char *src, *targ, *host, *user;
char *cmd;
char *src, *targ, *host, *user;
char *cmd;
if (argc != 2)
bump("More than one remote source not supported");
if (argc != 2)
bump("More than one remote source not supported");