forked from premiere/premiere-libtorrent
handle invalid arguments to set_piece_deadline()
This commit is contained in:
parent
f04d729d43
commit
046bb76361
|
@ -1,3 +1,4 @@
|
||||||
|
* handle invalid arguments to set_piece_deadline()
|
||||||
* move_storage did not work for torrents without metadata
|
* move_storage did not work for torrents without metadata
|
||||||
* improve shutdown time by only announcing to trackers whose IP we know
|
* improve shutdown time by only announcing to trackers whose IP we know
|
||||||
* fix python3 portability issue in python binding
|
* fix python3 portability issue in python binding
|
||||||
|
|
|
@ -375,14 +375,14 @@ namespace libtorrent
|
||||||
// deadline (and flags) of a piece can be changed by calling this
|
// deadline (and flags) of a piece can be changed by calling this
|
||||||
// function again.
|
// function again.
|
||||||
//
|
//
|
||||||
// The ``flags`` parameter can be used to ask libtorrent to send an alert
|
// The ``flags`` parameter can be used to ask libtorrent to post an alert
|
||||||
// once the piece has been downloaded, by passing alert_when_available.
|
// once the piece has been downloaded, by passing alert_when_available.
|
||||||
// When set, the read_piece_alert alert will be delivered, with the piece
|
// When set, the read_piece_alert alert will be delivered, with the piece
|
||||||
// data, when it's downloaded.
|
// data, when it's downloaded.
|
||||||
//
|
//
|
||||||
// If the piece is already downloaded when this call is made, nothing
|
// If the piece is already downloaded when this call is made, nothing
|
||||||
// happens, unless the alert_when_available flag is set, in which case it
|
// happens, unless the alert_when_available flag is set, in which case it
|
||||||
// will do the same thing as calling read_piece() for ``index``.
|
// will have the same effect as calling read_piece() for ``index``.
|
||||||
//
|
//
|
||||||
// ``deadline`` is the number of milliseconds until this piece should be
|
// ``deadline`` is the number of milliseconds until this piece should be
|
||||||
// completed.
|
// completed.
|
||||||
|
|
|
@ -5235,7 +5235,13 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
if (m_abort)
|
TORRENT_ASSERT_PRECOND(piece >= 0);
|
||||||
|
TORRENT_ASSERT_PRECOND(valid_metadata());
|
||||||
|
TORRENT_ASSERT_PRECOND(valid_metadata() && piece < m_torrent_file->num_pieces());
|
||||||
|
|
||||||
|
if (m_abort || !valid_metadata()
|
||||||
|
|| piece < 0
|
||||||
|
|| piece >= m_torrent_file->num_pieces())
|
||||||
{
|
{
|
||||||
// failed
|
// failed
|
||||||
if (flags & torrent_handle::alert_when_available)
|
if (flags & torrent_handle::alert_when_available)
|
||||||
|
|
Loading…
Reference in New Issue