FTPKit icon indicating copy to clipboard operation
FTPKit copied to clipboard

Cancel FTP Request Method?

Open bchessin opened this issue 7 years ago • 3 comments

@PeqNP What would be the easiest way to implement a command to cancel a FTP request? I tried making a stackoverflow question for this: http://stackoverflow.com/questions/43284819/ftpkit-abort-cancel-ftp-operation, however it seems as if this is too specific of an issue to ask there.

What are your suggestions?

bchessin avatar Apr 08 '17 04:04 bchessin

If using the ftplib, either FtpClose or FtpQuit. I don't have time to look into it, as I've stopped working on this library. If you happen to get it working I would be more than happy to accept any changes though!

PeqNP avatar Apr 08 '17 10:04 PeqNP

@PeqNP I understand. Just trying to currently wrap my head around the library. So for example, if I am trying to cancel a list request, is a good way of implementing this to keep an ivar of the netbuf that is from the listContentsAtHandle method? And then I would create my own method which would do something like FtpClose(listBuf), or something along those lines? Any guidance is appreciated.

bchessin avatar Apr 08 '17 15:04 bchessin

As a follow up (maybe you can immediately see the flaw in my logic). If I do a list request, and in the middle I cancel using FTPClose (like I mentioned in my previous post), then immediately after do a download request, it results in a EXC_BAD_ACCESS crash right after my [client downloadFile ...] request.

bchessin avatar Apr 08 '17 16:04 bchessin