cURL / Mailing Lists / curl-library / Single Mail

curl-library

Support for CURLOPT_NOBODY with SFTP

From: Scott Barrett <scott_barrett_at_partech.com>
Date: Wed, 12 Mar 2008 16:05:32 -0400

Hello,

I've been working with libcurl to perform file-related operations over FTP and
SFTP. When using the FTP protocol, I've found it handy to use the
CURLOPT_NOBODY option along with quoted commands (e.g. RMD, DELE) in order to
perform remote file system manipulation without incurring a transfer.

The same capability is not currently available when using the SFTP protocol,
even for the limited set of supported quoted commands added in 7.16.3.

Is there a philosophical or technical reason for not supporting the
CURLOPT_NOBODY option with SFTP?

I can see in the state machine for SFTP (in ssh.c) where it would be possible to
check the no_body bit of the connection and transition from SSH_SFTP_TRANS_INIT
to SSH_STOP (when the request isn't an upload).

I didn't see an SFTP section on the TODO page. If there's no reason not to
support such behavior, and it's not already on somebody's private TO-DO list,
I'd be happy to give it a whirl.

- Scott
Received on 2008-03-12