cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: code look over

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 3 Dec 2009 23:15:10 +0100 (CET)

On Wed, 2 Dec 2009, Seth Vidal wrote:

> I ported urlgrabber from using urllib[2] to using pycurl. This port was
> primarily done for the FIPS certification of NSS which urllib does not use
> but curl does. The goal was to maintain api compat for urlgrabber so none of
> the programs using urlgrabber would have to change anything. So there are a
> couple of acrobatic items in the PyCurlFileObject class to facilitate that.

Yeah, I've noticed this and I'm liking your switch. Mostly because I like
seeing more users of libcurl. Everywhere, anytime for any reason! ;-)

Is it working out fine? It's quite a feat to replace such a fundamental
underlying layer and still have everything on top of it keep running fine and
unmodified.

> If anyone has suggestions on items I can blow away or better ways to handle
> it I'd appreciate the input.

I'm not very experienced in Python nor pycurl, but I got to things in my mind
when I read this:

1 - CURLOPT_ERRORBUFFER might be a good idea to use to get more specific error
     messages from libcurl when problems happen.

2 - You may want to consider using CURLOPT_DEBUGFUNCTION instead of "just"
     CURLOPT_VERBOSE for the debug mode, since it is better at showing exactly
     what is sent and what is received and while I don't know in which
     situation you'll use the debug mode I've often found VERBOSE
     alone insufficient.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-03