curl-and-python

NOSIGNAL confusion

From: Tsai Li Ming <mailinglist_at_ltsai.com>
Date: Tue, 07 Jun 2005 23:41:10 +0800

Hi

Looking at one of the example codes, retriever-multi.py.

 From the libcurl documentation, I understand NOSIGNAL has to be set to
1 when using multi-thread program.

1. Is retriever-multi considered a mult-thread program?

2. Since the process is not getting a signal when NOSIGNAL is set to 1,
    why is SIGPIPE being ignored?

3. Does the process get a signal when NOSIGNAL is set to 0? I tried the
    following:

    def handler(signum, frame):
        print 'Signal handler called with signal', signum

    signal.signal(signal.SIGPIPE, handler)
    signal.signal(signal.SIGALRM, handler)

    c = pycurl.Curl()
    c.setopt(c.URL, sys.argv[1])
    c.setopt(c.WRITEFUNCTION, callback)
    c.setopt(pycurl.NOSIGNAL, 0)
    c.perform()
    c.close()

    # python retrieve.py http://www.yahoo.com
    Traceback (most recent call last):
    File "basicfirst.py", line 39, in ?
      c.perform()
    pycurl.error: (6, "Couldn't resolve host 'www.yahoo.com'")

I'm using libcurl 7.14.0 with pycurl 7.13.2

Thanks,
Liming

_______________________________________________
http://cool.haxx.se/mailman/listinfo/curl-and-python
Received on 2005-06-07