(self)
| 1179 | |
| 1180 | |
| 1181 | def _get_line(self): |
| 1182 | |
| 1183 | line = self.readline() |
| 1184 | if not line: |
| 1185 | raise self.abort('socket error: EOF') |
| 1186 | |
| 1187 | # Protocol mandates all lines terminated by CRLF |
| 1188 | if not line.endswith(b'\r\n'): |
| 1189 | raise self.abort('socket error: unterminated line: %r' % line) |
| 1190 | |
| 1191 | line = line[:-2] |
| 1192 | if __debug__: |
| 1193 | if self.debug >= 4: |
| 1194 | self._mesg('< %r' % line) |
| 1195 | else: |
| 1196 | self._log('< %r' % line) |
| 1197 | return line |
| 1198 | |
| 1199 | |
| 1200 | def _match(self, cre, s): |