cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Support for CURLOPT_NOBODY with SFTP

From: Scott Barrett <scott_barrett_at_partech.com>
Date: Thu, 20 Mar 2008 07:43:04 -0400

Here's a diff against version 1.98 of ssh.c that enables CURLOPT_NOBODY for
SFTP. It sidesteps a transfer if you just want to perform file system
manipulation (e.g., renaming, deleting, linking).

- Scott

diff -u ssh-1.98.c ssh.c
--- ssh-1.98.c Thu Mar 20 07:20:12 2008
+++ ssh.c Thu Mar 20 07:21:23 2008
@@ -1180,7 +1180,9 @@
      if(data->set.upload)
        state(conn, SSH_SFTP_UPLOAD_INIT);
      else {
- if(sftp_scp->path[strlen(sftp_scp->path)-1] == '/')
+ if(conn->bits.no_body)
+ state(conn, SSH_STOP);
+ else if(sftp_scp->path[strlen(sftp_scp->path)-1] == '/')
          state(conn, SSH_SFTP_READDIR_INIT);
        else
          state(conn, SSH_SFTP_DOWNLOAD_INIT);
Received on 2008-03-20