

def perform(self, logfile=None):
    'Fetch all of the added Request objects.\n\n        Return two lists. The first list is a list of responses that\n        completed. The second is list of the requests that errored.\n        '
    m = pycurl.CurlMulti()
    requests = []
    num_q = num_urls = len(self._requests)
    reqs = self._requests
    self._requests = []
    for req in reqs:
        (c, resp) = req.get_requester()
        c.resp = resp
        m.add_handle(c)
        requests.append(c)
    del reqs
    while 1:
        (ret, num_handles) = m.perform()
        if (ret != pycurl.E_CALL_MULTI_PERFORM):
            break
    num_handles = num_urls
    while num_handles:
        ret = m.select(5.0)
        if (ret == (- 1)):
            continue
        while 1:
            (ret, num_handles) = m.perform()
            if (ret != pycurl.E_CALL_MULTI_PERFORM):
                break
    goodlist = []
    errlist = []
    while 1:
        (num_q, ok_list, err_list) = m.info_read(num_urls)
        for c in ok_list:
            resp = c.resp
            del c.resp
            resp.error = None
            m.remove_handle(c)
            resp.finalize(c)
            goodlist.append(resp)
        for (c, errno, errmsg) in err_list:
            resp = c.resp
            del c.resp
            resp.error = (errno, errmsg)
            m.remove_handle(c)
            errlist.append(resp)
        if (num_q == 0):
            break
    m.close()
    return (goodlist, errlist)

dataset/ETHPy150Open kdart/pycopia/WWW/pycopia/WWW/client.py HTTPConnectionManager.perform/original