def fetch(self, command):
        """
        Run a command on the Varnish backend and return the result
        return value is a tuple of ((status, length), content)
        """
        logging.debug('SENT: %s: %s' % (self.host, command))
        self.write('%s\n' % command)
        while 1:
            buffer = self.read_until('\n').strip()
            if len(buffer):
                break
        status, length = map(int, buffer.split())
        content = ''
        assert status == 200, 'Bad response code: {status} {text} ({command})'.format(status=status, text=self.read_until('\n').strip(), command=command)
        while len(content) < length:
            content += self.read_until('\n')
        logging.debug('RECV: %s: %dB %s' % (status,length,content[:30]))
        self.read_eager()
        return (status, length), content
def fetch ( self , command ) : logging . debug ( 'SENT: %s: %s' % ( self . host , command ) ) self . write ( '%s\n' % command ) while 1 : buffer = self . read_until ( '\n' ) . strip ( ) if len ( buffer ) : break status , length = map ( int , buffer . split ( ) ) content = '' assert status == 200 , 'Bad response code: {status} {text} ({command})' . format ( status = status , text = self . read_until ( '\n' ) . strip ( ) , command = command ) while len ( content ) < length : content += self . read_until ( '\n' ) logging . debug ( 'RECV: %s: %dB %s' % ( status , length , content [ : 30 ] ) ) self . read_eager ( ) return ( status , length ) , content
Run a command on the Varnish backend and return the result
        return value is a tuple of ((status, length), content)