def requestOnce(self, conn, req):
        if self.proxy and self.proxy.userpass[0] and not self.doTunnel:
            req.headers['Proxy-Authorization'] = ('Basic ' +
                    base64.b64encode(":".join(self.proxy.userpass)))
        try:
            req.sendRequest(conn, isProxied=(self.proxy is not None))
        except (KeyboardInterrupt, __HOLE__):
            raise
        except:
            wrapped = util.SavedException()
            raise http_error.RequestError(wrapped)

        # Wait for a response.
        lastTimeout = time.time()
        while True:
            if req.abortCheck and req.abortCheck():
                raise http_error.AbortError()

            # Wait 5 seconds for a response.
            try:
                active = select.select([conn.sock], [], [], 5)[0]
            except select.error, err:
                if err.args[0] == errno.EINTR:
                    # Interrupted system call -- we caught a signal but it was
                    # handled safely.
                    continue
                raise
            if active:
                break

            # Still no response from the server. Send blank lines to keep the
            # connection alive, in case the server is behind a load balancer or
            # firewall with short connection timeouts.
            now = time.time()
            if now - lastTimeout >= 15:
                conn.send('\r\n')
                lastTimeout = now

        return conn.getresponse()
dataset/ETHPy150Open sassoftware/conary/conary/lib/http/connection.py/Connection.requestOnce