fix bug on write-only disk errors (it's not supposed to stop the torrent)

This commit is contained in:
arvidn 2015-06-15 02:27:09 -04:00
parent 3c74ab01a4
commit bd2bcf12bc
2 changed files with 6 additions and 3 deletions

View File

@ -1156,9 +1156,6 @@ namespace libtorrent
alerts().emplace_alert<file_error_alert>(j->error.ec
, resolve_filename(j->error.file), j->error.operation_str(), get_handle());
// put the torrent in an error-state
set_error(j->error.ec, j->error.file);
// if a write operation failed, and future writes are likely to
// fail, while reads may succeed, just set the torrent to upload mode
// if we make an incorrect assumption here, it's not the end of the
@ -1182,6 +1179,9 @@ namespace libtorrent
return;
}
// put the torrent in an error-state
set_error(j->error.ec, j->error.file);
// if the error appears to be more serious than a full disk, just pause the torrent
pause();
}

View File

@ -311,6 +311,9 @@ void test_transfer(int proxy_type, settings_pack const& sett
print_alerts(ses1, "ses1", true, true, true, &on_alert);
print_alerts(ses2, "ses2", true, true, true, &on_alert);
std::string err = tor2.status().error;
fprintf(stderr, "error: \"%s\"\n", err.c_str());
TEST_CHECK(err.empty());
tor2.set_upload_mode(false);
// at this point we probably disconnected the seed