mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
Check error codes correctly in instead of reporting all errors as 'assert'.
Add TR_ERROR_IO_SPACE and TR_ERROR_IO_RESOURCES.
This commit is contained in:
+14
-6
@@ -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 );
|
||||
}
|
||||
|
||||
+4
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
***********************************************************************
|
||||
|
||||
Reference in New Issue
Block a user