http.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:vivisect-py3 作者: bat-serjo 项目源码 文件源码
def _cobra_http_getsock(self):
        thr = currentThread()
        tsocks = getattr(thr, 'cobrahttpsocks', None)
        if tsocks == None:
            tsocks = {}
            thr.cobrahttpsocks = tsocks

        sock = tsocks.get(self._cobra_slookup)
        if not sock or sock.trashed:
            # Lets build a new socket... shall we?
            sock = self._cobra_http_newsock()

            # If we have authinfo lets authenticate
            authinfo = self._cobra_kwargs.get('authinfo')
            if authinfo != None:
                sock.authUser(authinfo)

            tsocks[self._cobra_slookup] = sock
        return sock
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号