(self, size=None)
| 202 | return data |
| 203 | |
| 204 | def readline(self, size=None): |
| 205 | if size is not None: |
| 206 | data = self.rfile.readline(size) |
| 207 | self.bytes_read += len(data) |
| 208 | self._check_length() |
| 209 | return data |
| 210 | |
| 211 | # User didn't specify a size ... |
| 212 | # We read the line in chunks to make sure it's not a 100MB line ! |
| 213 | res = [] |
| 214 | while True: |
| 215 | data = self.rfile.readline(256) |
| 216 | self.bytes_read += len(data) |
| 217 | self._check_length() |
| 218 | res.append(data) |
| 219 | # See http://www.cherrypy.org/ticket/421 |
| 220 | if len(data) < 256 or data[-1:] == "\n": |
| 221 | return ''.join(res) |
| 222 | |
| 223 | def readlines(self, sizehint=0): |
| 224 | # Shamelessly stolen from StringIO |
no test coverage detected