[bt-devel] Crash While Canceling Bookshelf Download

Eeli Kaikkonen eekaikko at mail.student.oulu.fi
Sat Nov 7 07:32:52 MST 2009


On Fri, 6 Nov 2009, Gary Holmlund wrote:
> Since my_fprogress is not in the CURLFTPTrnsport class I wrote a couple
> of access functions to get the "term" and "statusReporter" variables. I
> made the other changes from the posts.
>
> int my_fprogress(void *clientp, double dltotal, double dlnow, double
> ultotal, double ulnow) {
>     if (clientp) {
>         ((CURLFTPTransport
> *)clientp)->getStatusReporter()->statusUpdate(dltotal,dlnow);
> //        ((StatusReporter *)clientp)->statusUpdate(dltotal, dlnow);
>     }
>     return ((CURLFTPTransport *)clientp)->getTerminate();
> }
>
> It seems to work very well. I tested with multiple downloads and the
> cancel or stop all was almost immediate. I uploaded the version so you
> could try it.
>
> http://sourcearchives.com/downloads/bibletime-2.4.+svnr1763+swordpatch-win32.exe

OK, we can test this as well. I'm not sure if you follow the sword-devel
mailing list, but if not, we have done some overlapping work. It's not
dangerous, on the contrary it may be useful, but you could publish your
work also in sword-devel for larger audience. Troy already gave a third
possible solution.

BTW, getStatusReporter() should also be tested for null value because
the status reporter isn't guaranteed to be set.

  Yours,
	Eeli Kaikkonen (Mr.), Oulu, Finland
	e-mail: eekaikko at mailx.studentx.oulux.fix (with no x)



More information about the bt-devel mailing list