|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker mailing list Archives
[ curl-Bugs-2667901 ] libcurl 7.19.4
From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sat, 07 Mar 2009 04:09:14 +0000
Bugs item #2667901, was opened at 2009-03-06 03:06
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
Python fetch function code:
num_processed = 0
num_pool = len(pool)
ret=[]
conn = min(num_pool,conn)
m = CurlMulti()
m.handles = []
for i in range(conn):
c = Curl()
c.setopt(FOLLOWLOCATION, 1)
c.setopt(MAXREDIRS, 2)
c.setopt(NOSIGNAL, 0)
c.setopt(CONNECTTIMEOUT, 3)
c.setopt(TIMEOUT, 5)
c.setopt(HTTPHEADER, ['User-Agent: Mozilla/5.0 (rv:1.8.1.12) Gecko/20080129 Firefox/2.0.0.14 Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14'])
m.handles.append(c)
worker = m.handles[:]
while num_pool > num_processed:
while worker and pool:
url = pool.pop()
while url in pool:
pool.remove(url)
num_pool=num_pool-1
c= worker.pop()
c.res = cStringIO.StringIO()
c.setopt(URL,url)
c.setopt(WRITEFUNCTION,c.res.write)
m.add_handle(c)
c.url=url
while 1:
ret,num_h = m.perform()
if ret != E_CALL_MULTI_PERFORM: break
while 1:
num_q, ok_list, err_list = m.info_read()
for c in ok_list:
m.remove_handle(c)
c.data=c.res.getvalue()
worker.append(c)
print c.url
break
for mask in func:
if re.findall(mask[1],c.url):
mask[0](c)
for c, errno, errmsg in err_list:
m.remove_handle(c)
c.data=c.res.getvalue()
worker.append(c)
num_processed = num_processed + len(ok_list)
if num_q == 0:
break
try:
m.select(1.0)
except:
pass
return
When I run the function fetch formed 300 threads, these threads install curl and the next step is to collapse dns server. The problem is that if the dns server that is (gethostbyname ()) does not answer, then my script stops at X time, until you reply. This delat curlMulti bad.
STOP IN THE:
Strace give the:
log BIND9 Say the:
My email: northcustoms_AT_ya.ru
----------------------------------------------------------------------
>Comment By: Dan Fandrich (dfandrich)
Message:
----------------------------------------------------------------------
You can respond by visiting:
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info