(self, length=None)
return ret
Reads a single line (up to `length' characters long) from the SSL
        connection.
Reads a single line (up to `length' characters long) from the SSL
        connection.
Reads a single line ( up to length characters long ) from the SSL connection .
def readline(self, length=None):
        """
        Reads a single line (up to `length' characters long) from the SSL
        connection.
        """
        self._check_closed()
        while True:
            # charcount contains the number of chars to be outputted (or None
            # if none to be outputted at this time)
            charcount = None
            i = self._buffer.find('\n')
            if i >= 0:
                # Go one char past newline
                charcount = i + 1
            elif length and len(self._buffer) >= length:
                charcount = length

            if charcount is not None:
                ret = self._buffer[:charcount]
                self._buffer = self._buffer[charcount:]
                self._pos = self._pos + len(ret)
                return ret

            # Determine the number of chars to be read next
            bufsize = self._buffer_size
            if length:
                # we know length > len(self._buffer)
                bufsize = min(self._buffer_size, length - len(self._buffer))

            try:
                data = self._connection.recv(bufsize)
                self._buffer = self._buffer + data
            except SSL.ZeroReturnError:
                # Nothing more to be read
                break
            except SSL.WantWriteError:
                self._poll(select.POLLOUT, 'readline')
            except SSL.WantReadError:
                self._poll(select.POLLIN, 'readline')

        # We got here if we're done reading, so return everything
        ret = self._buffer
        self._buffer = ""
        self._pos = self._pos + len(ret)
        return ret
def readline ( self , length = None ) : self . _check_closed ( ) while True : # charcount contains the number of chars to be outputted (or None # if none to be outputted at this time) charcount = None i = self . _buffer . find ( '\n' ) if i >= 0 : # Go one char past newline charcount = i + 1 elif length and len ( self . _buffer ) >= length : charcount = length if charcount is not None : ret = self . _buffer [ : charcount ] self . _buffer = self . _buffer [ charcount : ] self . _pos = self . _pos + len ( ret ) return ret # Determine the number of chars to be read next bufsize = self . _buffer_size if length : # we know length > len(self._buffer) bufsize = min ( self . _buffer_size , length - len ( self . _buffer ) ) try : data = self . _connection . recv ( bufsize ) self . _buffer = self . _buffer + data except SSL . ZeroReturnError : # Nothing more to be read break except SSL . WantWriteError : self . _poll ( select . POLLOUT , 'readline' ) except SSL . WantReadError : self . _poll ( select . POLLIN , 'readline' ) # We got here if we're done reading, so return everything ret = self . _buffer self . _buffer = "" self . _pos = self . _pos + len ( ret ) return ret