def make_connection(self, host): try: if self._scheme == 'http': return Transport.make_connection(self, host) return SafeTransport.make_connection(self, host) except socket.error, e: raise ProtocolError(host, -1, "Could not connect to server", None)
def make_connection(self, host): self.host = host if self.proxy: host = self.proxy.split('://', 1)[-1] if self.https: c = SafeTransport.make_connection(self, host) else: c = Transport.make_connection(self, host) c.timeout = self.timeout return c
def make_connection(self, host): self.realhost = host proxies = urllib.getproxies() proxyurl = None if 'http' in proxies: proxyurl = proxies['http'] elif 'all' in proxies: proxyurl = proxies['all'] if proxyurl: urltype, proxyhost = urllib.splittype(proxyurl) host, selector = urllib.splithost(proxyhost) h = httplib.HTTP(host) self.proxy_is_used = True return h else: self.proxy_is_used = False return Transport.make_connection(self, host)
def make_connection(self, host): """Create the connection for the transport and save it.""" self.conn = Transport.make_connection(self, host) return self.conn
def make_connection(self, host): c = Transport.make_connection(self, host) c.timeout = self.timeout return c
def make_connection(self, host): conn = Transport.make_connection(self, host) conn.timeout = self._timeout return conn
def make_connection(self, host): conn = Transport.make_connection(self, host) if self.timeout: conn.timeout = self.timeout return conn