curl-and-python
Re: Connection Caching with SFTP
Date: Thu, 18 Oct 2007 13:49:40 +0200
hi,
this is likely to be a libcurl issue, someone asked the same question
some weeks ago regarding libcurl and sftp connection re-use:
http://curl.haxx.se/mail/lib-2007-09/0229.html
i don't know anything this issue, though...
regards,
- kjetil
On 10/18/07, joel vennin <joel.vennin_at_gmail.com> wrote:
> Hi,
>
> I use pycurl to transfer file using SFTP. I'm able to get a list of file for
> a specific directory without any problem.
>
> When i've the list of file to download, I download them. However, for each
> file it creates a new connection.
> An example of my code:
>
>
> ...
> files = getListFiles
> ...
>
> c = pycurl.Curl()
> c.setopt(c.MAXCONNECTIONS, 10)
> c.setopt(c.WRITEFUNCTION, myFunc)
> for x in files:
> c.setopt(c.URL, computeURL(x))
> c.perform()
>
> c.close()
>
>
>
> * Connected to xxx (Y.Y.Y.Y) port 22 (#0)
> * SSH authentication methods available: publickey,password
> * Using ssh public key file /home/jol/.ssh/id_dsa.pub
> * Using ssh private key file /home/jol/.ssh/id_dsa
> * Initialized SSH public key authentication
> * Authentication complete
> * Closing connection #0
> * About to connect() to xxx port 22 (#0)
> * Trying Y.Y.Y.Y.. * connected
> * Connected to execus-rech-1 (Y.Y.Y.Y) port 22 (#0)
> * SSH authentication methods available: publickey,password
> * Using ssh public key file /home/jol/.ssh/id_dsa.pub
> * Using ssh private key file /home/jol/.ssh/id_dsa
> * Initialized SSH public key authentication
> * Authentication complete
> * Closing connection #0
>
> Do you know how I can avoid the reconnection process for each downloaded
> file ?
>
>
> Jol
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2007-10-18