cURL / Mailing Lists / curl-library / Single Mail


Re: Changes to ssh.c

From: Daniel Stenberg <>
Date: Mon, 25 Jun 2007 23:59:45 +0200 (CEST)

On Mon, 25 Jun 2007, James Housley wrote:

> The first difference is using libssh2_sftp_readdir_ex() to read the
> directory text entry from the server, which includes the user and group
> names instead of numbers. That one is simple.


> The second is using Curl_debug() instead of infof(). This one I would like
> some clarification on, because I am sure there are lots of places that
> infof() is being used when it shouldn't be.

All places where you provide additional information or merely debug text, you
can and should use infof(). Curl_debug() is for providing (incoming or
outgoing) protocol data to the debug callback/functionality - the function
actually allows the caller to differentiate between data and headers, for the
protocols that feature the distinction.

Example: When you get SSH data to send to the app, you also pass it to
Curl_debug() (most likely in some kind of raw but still unencrypted format),
but if you want to add something there about why something is done or so,
infof() is the function for it.

> The third is "PWD". The curl interface to libssh2 doesn't allow the
> external program to find the "home" directory that you log into. I added a
> very simple command to postquote to honor the FTP "PWD" command.

I think that can come handy for some people.

> Should there be an option to have SFTP simulate FTP commands and responses
> to make programs that use them be able to seamlessly as possible use the
> SFTP protocol?

I don't think so. I think that will just be a lot of work but then in the end
there will always be differences and quirks that will make them differ anyway.
I think we can just as well ask the users to write SFTP-specific "quote"

> Lastly, will start converting the rest of ssh.c to operate in a state
> machine so ssh.c won't block curl when used in multi_*()


  Commercial curl and libcurl Technical Support:
Received on 2007-06-26