예제 #1
0
파일: http11.py 프로젝트: zz1512/scrapy
    def __init__(self, settings):
        self._pool = HTTPConnectionPool(reactor, persistent=True)
        self._pool.maxPersistentPerHost = settings.getint(
            'CONCURRENT_REQUESTS_PER_DOMAIN')
        self._pool._factory.noisy = False

        self._sslMethod = openssl_methods[settings.get(
            'DOWNLOADER_CLIENT_TLS_METHOD')]
        self._contextFactoryClass = load_object(
            settings['DOWNLOADER_CLIENTCONTEXTFACTORY'])
        # try method-aware context factory
        try:
            self._contextFactory = self._contextFactoryClass(
                method=self._sslMethod)
        except TypeError:
            # use context factory defaults
            self._contextFactory = self._contextFactoryClass()
            msg = """
 '%s' does not accept `method` argument (type OpenSSL.SSL method,\
 e.g. OpenSSL.SSL.SSLv23_METHOD).\
 Please upgrade your context factory class to handle it or ignore it.""" % (
                settings['DOWNLOADER_CLIENTCONTEXTFACTORY'], )
            warnings.warn(msg)
        self._default_maxsize = settings.getint('DOWNLOAD_MAXSIZE')
        self._default_warnsize = settings.getint('DOWNLOAD_WARNSIZE')
        self._disconnect_timeout = 1
예제 #2
0
파일: http11.py 프로젝트: zezhen/scrapy
 def __init__(self, settings):
     self._pool = HTTPConnectionPool(reactor, persistent=True)
     self._pool.maxPersistentPerHost = settings.getint(
         'CONCURRENT_REQUESTS_PER_DOMAIN')
     self._pool._factory.noisy = False
     self._contextFactoryClass = load_object(
         settings['DOWNLOADER_CLIENTCONTEXTFACTORY'])
     self._contextFactory = self._contextFactoryClass()
예제 #3
0
 def __init__(self, settings):
     self._pool = HTTPConnectionPool(reactor, persistent=True)
     self._pool._factory.noisy = False
     self._contextFactoryClass = load_object(
         settings['DOWNLOADER_CLIENTCONTEXTFACTORY'])
     self._contextFactory = self._contextFactoryClass()