cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libssh2 patch 10/17

From: James Housley <jim_at_thehousleys.net>
Date: Thu, 19 Oct 2006 13:07:05 -0400

On Oct 19, 2006, at 12:40 PM, Daniel Stenberg wrote:

> On Thu, 19 Oct 2006, James Housley wrote:
>
>> Should build without modifications after running ./configure . At
>> least it does for me.
>
> It did so for me too. I've done successful downloads with scp.
>
> But I did find a slight flaw when trying it. When I try to scp a
> file that doesn't exist on the server, it responds:
>
> curl: (2) failed init

Okay, I will look at the error codes that I get back from libssh2.
And do the right thing.

>
> ... which indicates a wrong return code.
>
> I've also checked some of your source code now and I have these
> comments:
>
> 1 - You don't use the "standard" transfer functions within
> libcurl. You
> should Curl_setup_transfer() and then allow the Curl_readwrite
> () function
> to do the actual transfer, not do the loops yourself. An
> interesting test
> to verify this functionality is to write a test application
> that uses
> the multi interface to do SCP transfers... This is what I
> spoke about in
> my reply about state machines previously.

Are you looking at the current patch? Because scp now does that, and
sftp doesn't work and hasn't be edited.

>
> 2 - You use very long source lines. We use less than 80 columns
> per line in
> this project.

I have mine set to 132, I will try and keep them down to 80. I will
probably go back and edit/trim at some point.

>
> 3 - The using of the environment variable HOME to get path names
> doesn't seem
> like a thing for the library. I think those paths are better
> passed in to
> libcurl from the app.

That is also done in the 10/17 patch. It will try and use HOME if no
value is passed in.

>
> 4 - If you use infof() to log stuff, you'd be using the libcurl
> way to log.
> printf() is not really a good way.

In the recent code I have been looking in I see infof() and DEBUGF
(infof()), and will start switching to them.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
Q: Because it reverses the logical flow of conversation.
A: Why is putting a reply at the top of the message frowned upon?
Received on 2006-10-19