I'm trying to cancel a createInputStream using the OpenStreamProgressCallback.
I was expecting that returning false from OpenStreamProgressCallback would abort, but it does not work.
actually, the returned value of the callback is never checked in URLConnectionState::start() (i just checked on Mac)
Shouldn't it be changed to something like that ? Or isn't it made for that?
To clarify, I was expecting that returning false from the callback would abort the createInputStream() because of that comment in the doc :
/** This callback function can be used by the createInputStream() method.
It allows your app to receive progress updates during a lengthy POST operation. If you
want to continue the operation, this should return true, or false to abort.
*/
typedef bool (OpenStreamProgressCallback) (void* context, int bytesSent, int totalBytes);
I'm in a case where I want to abort the createInputStream from the callback before it ends because my threadShouldExit()
Any chance to get this possibility to abort a createInputString with the OpenStreamProgressCallback working? or am I having a wrong approach and misinterpreting the use of OpenStreamProgressCallback??
Sorry, yes, that is how it's supposed to work, and it's just on OSX where it doesn't (because of the way OSX handles this stuff internally).
But the current OSX implementation uses some deprecated APIs, and I've got a half-finished re-implementation of it in the works. When that's finished, I'll check that this works, but until then there's no point in us trying to fix the current code.
ok, I understand, but if you don't add a workaround, please write in the documentation that this does not work. it's a pity that we are loosing some time encountering "known bugs"
Sorry to come back to this, but the bug is there since 4 months, so again, if you donât add a workaround, why not adding a warning in the documentation saying that this does not work/is not implemented ?
Is the solution I posted in the first post (adding the check of the value returned by the callback) that terrible?