Abort a file transfer. Uses out-of-band data. This does not follow the procedure from the RFC to send Telnet IP and Synch; that doesn't seem to work with the servers I've tried. Instead, just send the ABOR command as OOB data.
(self)
| 262 | return resp |
| 263 | |
| 264 | def abort(self): |
| 265 | '''Abort a file transfer. Uses out-of-band data. |
| 266 | This does not follow the procedure from the RFC to send Telnet |
| 267 | IP and Synch; that doesn't seem to work with the servers I've |
| 268 | tried. Instead, just send the ABOR command as OOB data.''' |
| 269 | line = b'ABOR' + B_CRLF |
| 270 | if self.debugging > 1: |
| 271 | print('*put urgent*', self.sanitize(line)) |
| 272 | self.sock.sendall(line, MSG_OOB) |
| 273 | resp = self.getmultiline() |
| 274 | if resp[:3] not in {'426', '225', '226'}: |
| 275 | raise error_proto(resp) |
| 276 | return resp |
| 277 | |
| 278 | def sendcmd(self, cmd): |
| 279 | '''Send a command and return the response.''' |
no test coverage detected