if(data->set.upload)
state(conn, SSH_SFTP_UPLOAD_INIT);
else {
- if(data->set.opt_no_body)
- state(conn, SSH_STOP);
- else if(sftp_scp->path[strlen(sftp_scp->path)-1] == '/')
+ if(sftp_scp->path[strlen(sftp_scp->path)-1] == '/')
state(conn, SSH_SFTP_READDIR_INIT);
else
state(conn, SSH_SFTP_DOWNLOAD_INIT);
break;
case SSH_SFTP_READDIR_INIT:
+ Curl_pgrsSetDownloadSize(data, -1);
+ if(data->set.opt_no_body)
+ state(conn, SSH_STOP);
+
/*
* This is a directory that we are trying to get, so produce a directory
* listing
*/
data->req.size = -1;
data->req.maxdownload = -1;
+ Curl_pgrsSetDownloadSize(data, -1);
}
else {
curl_off_t size = attrs.filesize;
SFTP_SEEK(sshc->sftp_handle, data->state.resume_from);
}
}
+
+ if(data->set.opt_no_body)
+ state(conn, SSH_SFTP_CLOSE);
+
/* Setup the actual download */
if(data->req.size == 0) {
/* no data to transfer */