

def read(self, size=(- 1)):
    rbufsize = max(self._rbufsize, self.default_bufsize)
    buf = self._rbuf
    buf.seek(0, 2)
    if (size < 0):
        self._rbuf = StringIO()
        while True:
            try:
                data = self._sock.recv(rbufsize)
            except OpenSSL.SSL.WantReadError:
                continue
            if (not data):
                break
            buf.write(data)
        return buf.getvalue()
    else:
        buf_len = buf.tell()
        if (buf_len >= size):
            buf.seek(0)
            rv = buf.read(size)
            self._rbuf = StringIO()
            self._rbuf.write(buf.read())
            return rv
        self._rbuf = StringIO()
        while True:
            left = (size - buf_len)
            try:
                data = self._sock.recv(left)
            except OpenSSL.SSL.WantReadError:
                continue
            if (not data):
                break
            n = len(data)
            if ((n == size) and (not buf_len)):
                return data
            if (n == rbufsize):
                buf.write(data)
                del data
                break
            assert (n <= left), ('recv(%d) returned %d bytes' % (left, n))
            buf.write(data)
            buf_len += n
            del data
        return buf.getvalue()

dataset/ETHPy150Open Bolton-and-Menk-GIS/restapi/restapi/requests/packages/urllib3/contrib/pyopenssl.py fileobject.read/VarMisuse@275/328 `left`->`rbufsize`