cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libssh2 patch 11/1

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 2 Nov 2006 15:49:54 +0100 (CET)

On Wed, 1 Nov 2006, James Housley wrote:

> Here is the latest patch. Most of the fprintf(stderr have been converted to
> infof(), except for a few at the top of the file. These could not be
> converted since it does not have access to the curl structures. In the
> future they will likely be removed.

I have several objections, but this time I took time to edit them and my
updated patch is attached to this mail.

We must not use "libssh2" or anything like that in the public API and its
names, as we don't expect libssh2 to be the only SSH library forever, or at
least we won't limit the API for the possibility that others will be supported
one day. There's also the pure philosophical view that the API provides "ssh
features" and they are based around the protocol SSH and not specificly on a
particular SSH-lib.

Therefore, we must also not depend on or expose libssh2-related error codes in
the CURLcode type. We can indeed provide SSH-specific error codes (for the
cases where none of the already existing ones are good enough), but they must
be translated by the libssh2-aware layer into the curl-specific ones. Again,
we must consider SSH to be a protocol feature and not something that always
will be bound to libssh2.

I now made SSH-related errors get returned in the single error code CURLE_SSH
which is a bit too naive, so it leaves room for some improvements there.

Oh, and I renamed lib/sftp.[ch] to lib/ssh.[ch] since I think that's a more
suitable name.

Any of my changes you're opposing? I wouldn't mind committing what we have,
and we can base further work on that...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Received on 2006-11-02