[darcs-users] do we still need libwww support?

Ian Lynagh igloo at earth.li
Fri Mar 6 09:03:36 EST 2009

On Fri, Mar 06, 2009 at 08:24:32AM +0000, Eric Kow wrote:
> P.S. Ian's idea for camp was to use libcurl for everything, even
>      fetching files locally or over ssh.  I'd be curious to see
>      what he does for ssh connection sharing, though 

Well, it shouldn't be such a problem for camp anyway, due to the
repository format, but the answer is that I will let curl take care of

module Main (main) where

import Camp.Network
import System.Environment

main :: IO ()
main = withGlobalCurl $
       withCurl $ \curl -> do
           setSSHPrivateKey curl "/home/ian/.ssh/id_rsa_haskell_darcs"
           setSSHPublicKey curl "/home/ian/.ssh/id_rsa_haskell_darcs.pub"
           setVerbosity curl True
           urls <- getArgs
           let f url = do setURL curl (mkURL url)
                          perform curl
           mapM_ f urls

$ ./dl sftp://igloo@community.haskell.org/tmp/q.txt sftp://igloo@community.haskell.org/tmp/w.txt
* About to connect() to community.haskell.org port 22 (#0)
*   Trying * connected
* Connected to community.haskell.org ( port 22 (#0)
* SSH authentication methods available: publickey,keyboard-interactive
* Using ssh public key file /home/ian/.ssh/id_rsa_haskell_darcs.pub
* Using ssh private key file /home/ian/.ssh/id_rsa_haskell_darcs
* Initialized SSH public key authentication
* Authentication complete
This is q
* Connection #0 to host community.haskell.org left intact
* Re-using existing connection! (#0) with host community.haskell.org
* Connected to community.haskell.org ( port 22 (#0)
This is w
* Connection #0 to host community.haskell.org left intact
* Closing connection #0

Curl's easy interface will cache 5 connections by default, although you
can change the number (CURLOPT_MAXCONNECTS). I don't think camp will
need more than 1, though.


More information about the Camp mailing list