diff --git a/daemon/ipc.c b/daemon/ipc.c index 188e4ea92..18d93b30a 100644 --- a/daemon/ipc.c +++ b/daemon/ipc.c @@ -700,27 +700,35 @@ ipc_addstat( benc_val_t * list, int tor, tr_info_t * inf, { tr_bencInitStr( item, NULL, 0, 1 ); } - else if( TR_ERROR_ASSERT & st->error ) + else if( TR_ERROR_ISSET( TR_ERROR_ASSERT, st->error ) ) { tr_bencInitStr( item, "assert", -1, 1 ); } - else if( TR_ERROR_IO_PARENT & st->error ) + else if( TR_ERROR_ISSET( TR_ERROR_IO_PARENT, st->error ) ) { tr_bencInitStr( item, "io-parent", -1, 1 ); } - else if( TR_ERROR_IO_PERMISSIONS & st->error ) + else if( TR_ERROR_ISSET( TR_ERROR_IO_PERMISSIONS, st->error ) ) { tr_bencInitStr( item, "io-permissions", -1, 1 ); } - else if( TR_ERROR_IO_MASK & st->error ) + else if( TR_ERROR_ISSET( TR_ERROR_IO_SPACE, st->error ) ) + { + tr_bencInitStr( item, "io-space", -1, 1 ); + } + else if( TR_ERROR_ISSET( TR_ERROR_IO_RESOURCES, st->error ) ) + { + tr_bencInitStr( item, "io-resources", -1, 1 ); + } + else if( TR_ERROR_ISSET( TR_ERROR_IO_MASK, st->error ) ) { tr_bencInitStr( item, "io-other", -1, 1 ); } - else if( TR_ERROR_TC_ERROR & st->error ) + else if( TR_ERROR_ISSET( TR_ERROR_TC_ERROR, st->error ) ) { tr_bencInitStr( item, "tracker-error", -1, 1 ); } - else if( TR_ERROR_TC_WARNING & st->error ) + else if( TR_ERROR_ISSET( TR_ERROR_TC_WARNING, st->error ) ) { tr_bencInitStr( item, "tracker-warning", -1, 1 ); } diff --git a/daemon/ipcproto.txt b/daemon/ipcproto.txt index e3d825ad0..ff8adc7e2 100644 --- a/daemon/ipcproto.txt +++ b/daemon/ipcproto.txt @@ -386,8 +386,10 @@ which support is mandatory is "id". "download-total" integer, total bytes downloaded so far "error" string, one of the following: "assert" something happened that shouldn't - "io-parent" I dunno - "io-permissions" filesystem permission error probably + "io-parent" missing parent directory + "io-permissions" filesystem permission error + "io-space" not enough free space in filesystem + "io-resource" insufficient resources "io-other" other filesystem i/o error "tracker-error" tracker returned error message "tracker-warning" tracker returned warning message diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index f0f2abbf1..1216da408 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -80,6 +80,8 @@ extern "C" { #define TR_ERROR_TC_ERROR 0x80000100 #define TR_ERROR_TC_WARNING 0x80000200 +#define TR_ERROR_ISSET( num, code ) ( (code) == ( (code) & (num) ) ) + /*********************************************************************** * tr_init ***********************************************************************