Answer the question
In order to leave comments, you need to log in
pycurl.CurlMulti
Tell me where to dig with CurlMulti.
Such a problem: when you run curl in single-threaded mode, everything works fine and fast
for url in url_list:
curl = get_curl(url)
try:
curl.perform()
callback_func(curl)
except pycurl.error, e:
logging.error("%s:%s" % (e[0],e[1]))
c.setopt(pycurl.CONNECTTIMEOUT, 10)
c.setopt(pycurl.TIMEOUT, 15)
m = pycurl.CurlMulti()
m.handles = []
for url in url_list[:10]:
c = get_curl(url)
m.handles.append(c)
m.add_handle(c)
ret, num_handles = m.perform()
Answer the question
In order to leave comments, you need to log in
Thanks everyone, I solved the problem:
1 took the system libcurl
2 downloaded the source of the latest curl from curl.haxx.se/download.html
3 ./configure --enable-ares --with-ssl --enable-ipv6 --with-libidn
make
sudo checkinstall -D
4 sudo pip install -U --force-reinstall pycurl
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question