当前位置: 首页>>代码示例>>Python>>正文


Python pycurl.IPRESOLVE_V4属性代码示例

本文整理汇总了Python中pycurl.IPRESOLVE_V4属性的典型用法代码示例。如果您正苦于以下问题:Python pycurl.IPRESOLVE_V4属性的具体用法?Python pycurl.IPRESOLVE_V4怎么用?Python pycurl.IPRESOLVE_V4使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在pycurl的用法示例。


在下文中一共展示了pycurl.IPRESOLVE_V4属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _process_queue

# 需要导入模块: import pycurl [as 别名]
# 或者: from pycurl import IPRESOLVE_V4 [as 别名]
def _process_queue(self):
        while True:
            started = 0
            while self._free_list and self._requests:
                started += 1
                curl = self._free_list.pop()
                (request, callback) = self._requests.popleft()
                curl.info = {
                    "headers": httputil.HTTPHeaders(),
                    "buffer": cStringIO.StringIO(),
                    "request": request,
                    "callback": callback,
                    "start_time": time.time(),
                }
                # Disable IPv6 to mitigate the effects of this bug
                # on curl versions <= 7.21.0
                # http://sourceforge.net/tracker/?func=detail&aid=3017819&group_id=976&atid=100976
                if pycurl.version_info()[2] <= 0x71500:  # 7.21.0
                    curl.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V4)
                _curl_setup_request(curl, request, curl.info["buffer"],
                                    curl.info["headers"])
                self._multi.add_handle(curl)

            if not started:
                break 
开发者ID:omererdem,项目名称:honeything,代码行数:27,代码来源:httpclient.py

示例2: _process_queue

# 需要导入模块: import pycurl [as 别名]
# 或者: from pycurl import IPRESOLVE_V4 [as 别名]
def _process_queue(self):
        with stack_context.NullContext():
            while True:
                started = 0
                while self._free_list and self._requests:
                    started += 1
                    curl = self._free_list.pop()
                    (request, callback) = self._requests.popleft()
                    curl.info = {
                        "headers": httputil.HTTPHeaders(),
                        "buffer": BytesIO(),
                        "request": request,
                        "callback": callback,
                        "curl_start_time": time.time(),
                    }
                    # Disable IPv6 to mitigate the effects of this bug
                    # on curl versions <= 7.21.0
                    # http://sourceforge.net/tracker/?func=detail&aid=3017819&group_id=976&atid=100976
                    if pycurl.version_info()[2] <= 0x71500:  # 7.21.0
                        curl.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V4)
                    _curl_setup_request(curl, request, curl.info["buffer"],
                                        curl.info["headers"])
                    self._multi.add_handle(curl)

                if not started:
                    break 
开发者ID:viewfinderco,项目名称:viewfinder,代码行数:28,代码来源:curl_httpclient.py

示例3: _process_queue

# 需要导入模块: import pycurl [as 别名]
# 或者: from pycurl import IPRESOLVE_V4 [as 别名]
def _process_queue(self):
        with stack_context.NullContext():
            while True:
                started = 0
                while self._free_list and self._requests:
                    started += 1
                    curl = self._free_list.pop()
                    (request, callback) = self._requests.popleft()
                    curl.info = {
                        "headers": httputil.HTTPHeaders(),
                        "buffer": cStringIO.StringIO(),
                        "request": request,
                        "callback": callback,
                        "curl_start_time": monotime(),
                    }
                    # Disable IPv6 to mitigate the effects of this bug
                    # on curl versions <= 7.21.0
                    # http://sourceforge.net/tracker/?func=detail&aid=3017819&group_id=976&atid=100976
                    if pycurl.version_info()[2] <= 0x71500:  # 7.21.0
                        curl.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V4)
                    _curl_setup_request(curl, request, curl.info["buffer"],
                                        curl.info["headers"])
                    self._multi.add_handle(curl)

                if not started:
                    break 
开发者ID:omererdem,项目名称:honeything,代码行数:28,代码来源:curl_httpclient.py


注:本文中的pycurl.IPRESOLVE_V4属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。