[Libpdtp-svn] r40 - /
Status: Alpha
Brought to you by:
bascule
From: <tar...@pd...> - 2004-09-21 19:45:45
|
Author: tarcieri Date: 2004-09-21 13:45:35 -0600 (Tue, 21 Sep 2004) New Revision: 40 Modified: download.c Log: Download support updates and bugfixes Modified: download.c =================================================================== --- download.c 2004-09-09 18:49:34 UTC (rev 39) +++ download.c 2004-09-21 19:45:35 UTC (rev 40) @@ -217,11 +217,15 @@ pdtp_transaction_out_t out; pdtp_notifier_t notifier; + debug("pdtp_download_run() starting"); + /* pdtp_piecelist_create() handles not only MD5 checksumming but also truncating the file to the specified length */ if(!(list = pdtp__piecelist_create(file, (pdtp_filelen_t)dl->length, dl->piece_length, dl->hashes))) { /* XXX Some sort of error handling here */ + debug("Couldn't hash existing file"); + return; } @@ -250,11 +254,19 @@ return; } - if((i = pdtp__transaction_object_index(in, OBJ_HANDLE)) < 0) + if((i = pdtp__transaction_object_index(in, OBJ_HANDLE)) < 0) { +#ifndef NDEBUG + debug("No handle object!"); +#endif goto err; + } - if(pdtp__transaction_object_uint32(in, i, &dl->handle) < 0) + if(pdtp__transaction_object_uint32(in, i, &dl->handle) < 0) { +#ifndef NDEBUG + debug("Invalid handle object!"); +#endif goto err; + } #ifndef NDEBUG debug("dl->handle is: %d", dl->handle); @@ -285,14 +297,25 @@ dl->file = file; dl->callback = table; +#ifndef NDEBUG + debug("Calling pdtp__multiplexer_run()"); +#endif + pdtp__multiplexer_run(dl->mplx); err: pdtp_set_last_error(ERROR_DOWNLOAD_INIT); + +#ifndef NDEBUG + debug("Freeing transaction"); +#endif + pdtp__transaction_in_destroy(in); - pdtp__free(dl); /* XXX Yipe, we really need to do something here */ +#ifndef NDEBUG + debug("Error running download"); +#endif } void pdtp_download_stop(pdtp_download_t dl) |