From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id oBQ97FqQ021614 for ; Sun, 26 Dec 2010 10:07:15 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AioBAIKUFk3RVaE2kGdsb2JhbACDY5I0jhEIFQEBAQEJCQwHEQQgpRaJOzyCGINJLohXAQEDBYEbgzZ0BIUhhWODHWk X-IronPort-AV: E=Sophos;i="4.60,230,1291590000"; d="scan'208";a="93199147" Received: from mail-fx0-f54.google.com ([209.85.161.54]) by mail1-smtp-roc.national.inria.fr with ESMTP; 26 Dec 2010 10:07:10 +0100 Received: by fxm16 with SMTP id 16so8082579fxm.27 for ; Sun, 26 Dec 2010 01:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=g9FQN8ixwwRboxM40Mt8dd7AgllWLBSoZ/FjsHoT9jQ=; b=HbSlRYzLhYVeZf7jwm851wFeB2w0xz+4e/6wemisVjj0MH4WEFENBfVb5DB+38NL/a 5xkeNlpiBU/Z7hnuoGuQobbiICTruV+0QtEy8ViJQivQA0wmLBMLr/j9AwMuM1gdze02 hj3iG1TgvNJ4SrN6KbLaqTD6aTdEFwAnaipsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=LXQa55clOqrshIX4GN+ENCw1Rgtq4BWVQbj7z1sXTX9srFDwjZloHfZMxcePF8pewU 48JanPSmR8XBfDDXacDxh7Gf/QsX6LXyYQYRadrto9JKbMzVWY+2B5BgjAgVWvuZDNTq kJNoA1xjZyq6xDyuPzsecd/7JWgJcA0NJQHWs= Received: by 10.223.83.144 with SMTP id f16mr369307fal.4.1293354427840; Sun, 26 Dec 2010 01:07:07 -0800 (PST) Received: from [192.168.1.101] ([79.114.39.124]) by mx.google.com with ESMTPS id 17sm2711413far.43.2010.12.26.01.07.06 (version=SSLv3 cipher=RC4-MD5); Sun, 26 Dec 2010 01:07:06 -0800 (PST) Message-ID: <4D1705B9.3060609@gmail.com> Date: Sun, 26 Dec 2010 11:07:05 +0200 From: =?UTF-8?B?VMO2csO2ayBFZHdpbg==?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101213 Icedove/3.1.7 MIME-Version: 1.0 To: caml-list@inria.fr References: <20101225004412.GA10078@siouxsie> <4D15A634.9000309@gmail.com> <20101225183021.GA9316@siouxsie> <20101225202101.GA12780@siouxsie> <4D165360.3010806@gmail.com> <20101225231025.GA17456@siouxsie> In-Reply-To: <20101225231025.GA17456@siouxsie> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] https... which lib? On 2010-12-26 01:10, oliver@first.in-berlin.de wrote: > Hi, > > some more questions... > > On Sat, Dec 25, 2010 at 10:26:08PM +0200, Török Edwin wrote: >> On 2010-12-25 22:21, oliver@first.in-berlin.de wrote: >>> On Sat, Dec 25, 2010 at 07:30:21PM +0100, oliver@first.in-berlin.de wrote: >>>> On Sat, Dec 25, 2010 at 10:07:16AM +0200, Török Edwin wrote: >>>>> On 2010-12-25 02:44, oliver@first.in-berlin.de wrote: >>>>>> Hi, >>>>>> >>>>>> AFAIK I can't use ocamlnet for https-files?! >>>>>> >>>>>> Which lib do I need for that? >>>>> >>>>> I used libcurl-ocaml for https recently. >>>> [...] >>>> >>>> http://curl.haxx.se/libcurl/ocaml/ >>>> >>>> Has a simple easy-to-start example... >>>> ... and https works out of the box. >>> [...] >>> >>> But documentation lacks.... >>> >>> The functions seem not to have the same names as the C-counterparts... >>> >>> What function do I need for not getting the webpage printed to stdout, >>> but into a string? >> > [...] > > >> connection#set_timeout Config.timeout; >> connection#set_followlocation true; >> connection#set_connecttimeout Config.connect_timeout; > [...] > > > The method set_timeout and See CURLOPT_TIMEOUT, I think it is timeout for entire transfer, including DNS lookup. > the method set_connecttimeout, CURLOPT_CONNECTTIMEOUT, timeout for connect(). > what are they for and which value do they use? > > I would assume to set one timeout, not two. > > Is it in milli-seconds? No, it is in seconds. See CURLOPT_TIMEOUT, if you want miliseconds use CURLOPT_TIMEOUT_MS. BTW I remember some curl versions having trouble with multiple threads and timeouts, not sure if that is still the case but it is something to keep in mind if your OCaml app is multithreaded. > > > btw: I didn't found the docs for the OCaml-bindings of above mentioned methods. > > Also in the curl-lib-binding it's mentioned that only the "easy-interface" is bound, > but the OCaml-bindings offer much more functions than those some of the easy-interface > (http://curl.haxx.se/libcurl/c/libcurl-easy.html => 26 functions, the mli contains a lot more) . > So, somehow at some place the docs seem to be outdated (?). > If you have a link to a more up-to-date documentatiopn, if this exists, > could you sent me a link to that?! All I have are the ocamldoc-generated ones, which don't say what each method does, but it is not hard to guess. For example: 'val set_timeout : t -> int -> unit' is just a convenience function for 'setopt h CURLOPT_TIMEOUT(..)', that is curl_easy_setopt(.. CURLOPT_TIMEOUT ...). So read the docs for CURLOPT_TIMEOUT. Similarly each function also has an OO equivalent. > > Ciao, > Oliver > > P.S.: Does the method set_followlocation > set, if that curllib-connection is follwoing a redirect? Yes, it doesn't do that by default. Best regards, --Edwin