*** empty log message ***
This commit is contained in:
parent
999754ee23
commit
a5c91f683a
|
@ -2205,6 +2205,16 @@ blocks specified by <tt class="docutils literal"><span class="pre">bitmask</span
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr><td><tt class="docutils literal"><span class="pre">file</span> <span class="pre">sizes</span></tt></td>
|
||||||
|
<td>list where each entry corresponds to a file in the file list
|
||||||
|
in the metadata. Each entry has a list of two values, the
|
||||||
|
first value is the size of the file in bytes, the second
|
||||||
|
is the timestamp when the last time someone wrote to it.
|
||||||
|
This information is used to compare with the files on disk.
|
||||||
|
All the files must match exactly this information in order
|
||||||
|
to consider the resume data as current. Otherwise a full
|
||||||
|
re-check is issued.</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -115,7 +115,7 @@ namespace libtorrent
|
||||||
// loop in session_impl will check for this state
|
// loop in session_impl will check for this state
|
||||||
// on all torrents once every second, and take
|
// on all torrents once every second, and take
|
||||||
// the necessary actions then.
|
// the necessary actions then.
|
||||||
void abort() { m_abort = true; m_event = tracker_request::stopped; }
|
void abort();
|
||||||
bool is_aborted() const { return m_abort; }
|
bool is_aborted() const { return m_abort; }
|
||||||
|
|
||||||
// is called every second by session. This will
|
// is called every second by session. This will
|
||||||
|
@ -379,7 +379,7 @@ namespace libtorrent
|
||||||
// blocks when requested
|
// blocks when requested
|
||||||
int m_block_size;
|
int m_block_size;
|
||||||
|
|
||||||
// if this pointer is 0, the peer_connection is in
|
// if this pointer is 0, the torrent is in
|
||||||
// a state where the metadata hasn't been
|
// a state where the metadata hasn't been
|
||||||
// received yet.
|
// received yet.
|
||||||
std::auto_ptr<piece_manager> m_storage;
|
std::auto_ptr<piece_manager> m_storage;
|
||||||
|
|
|
@ -1310,10 +1310,13 @@ namespace libtorrent
|
||||||
void peer_connection::disconnect()
|
void peer_connection::disconnect()
|
||||||
{
|
{
|
||||||
if (m_disconnecting) return;
|
if (m_disconnecting) return;
|
||||||
detail::session_impl::connection_map::iterator i = m_ses.m_connections.find(m_socket);
|
detail::session_impl::connection_map::iterator i
|
||||||
|
= m_ses.m_connections.find(m_socket);
|
||||||
m_disconnecting = true;
|
m_disconnecting = true;
|
||||||
assert(i != m_ses.m_connections.end());
|
assert(i != m_ses.m_connections.end());
|
||||||
assert(std::find(m_ses.m_disconnect_peer.begin(), m_ses.m_disconnect_peer.end(), i) == m_ses.m_disconnect_peer.end());
|
assert(std::find(m_ses.m_disconnect_peer.begin()
|
||||||
|
, m_ses.m_disconnect_peer.end(), i)
|
||||||
|
== m_ses.m_disconnect_peer.end());
|
||||||
m_ses.m_disconnect_peer.push_back(i);
|
m_ses.m_disconnect_peer.push_back(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1849,6 +1852,7 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
|
assert(!m_disconnecting);
|
||||||
assert(!m_socket->is_blocking());
|
assert(!m_socket->is_blocking());
|
||||||
assert(m_packet_size > 0);
|
assert(m_packet_size > 0);
|
||||||
assert(m_socket->is_readable());
|
assert(m_socket->is_readable());
|
||||||
|
@ -2158,6 +2162,7 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
|
assert(!m_disconnecting);
|
||||||
assert(m_socket->is_writable());
|
assert(m_socket->is_writable());
|
||||||
assert(can_write());
|
assert(can_write());
|
||||||
|
|
||||||
|
|
|
@ -404,6 +404,7 @@ namespace libtorrent { namespace detail
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
check_invariant("before abort");
|
check_invariant("before abort");
|
||||||
#endif
|
#endif
|
||||||
|
purge_connections();
|
||||||
|
|
||||||
if (m_abort)
|
if (m_abort)
|
||||||
{
|
{
|
||||||
|
@ -690,8 +691,6 @@ namespace libtorrent { namespace detail
|
||||||
req.listen_port = m_listen_interface.port;
|
req.listen_port = m_listen_interface.port;
|
||||||
req.key = m_key;
|
req.key = m_key;
|
||||||
m_tracker_manager.queue_request(req, t.tracker_login());
|
m_tracker_manager.queue_request(req, t.tracker_login());
|
||||||
t.disconnect_all();
|
|
||||||
purge_connections();
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
sha1_hash i_hash = t.torrent_file().info_hash();
|
sha1_hash i_hash = t.torrent_file().info_hash();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -187,7 +187,7 @@ namespace libtorrent
|
||||||
size = file_size(f);
|
size = file_size(f);
|
||||||
time = last_write_time(f);
|
time = last_write_time(f);
|
||||||
}
|
}
|
||||||
catch (file_error&) {}
|
catch (std::exception&) {}
|
||||||
sizes.push_back(std::make_pair(size, time));
|
sizes.push_back(std::make_pair(size, time));
|
||||||
}
|
}
|
||||||
return sizes;
|
return sizes;
|
||||||
|
@ -215,7 +215,7 @@ namespace libtorrent
|
||||||
size = file_size(f);
|
size = file_size(f);
|
||||||
time = last_write_time(f);
|
time = last_write_time(f);
|
||||||
}
|
}
|
||||||
catch (file_error&) {}
|
catch (std::exception&) {}
|
||||||
if (size != s->first || time != s->second)
|
if (size != s->first || time != s->second)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -493,6 +493,15 @@ namespace libtorrent
|
||||||
assert(m_have_pieces[index] == false);
|
assert(m_have_pieces[index] == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void torrent::abort()
|
||||||
|
{
|
||||||
|
m_abort = true;
|
||||||
|
m_event = tracker_request::stopped;
|
||||||
|
// disconnect all peers and close all
|
||||||
|
// files belonging to the torrent
|
||||||
|
disconnect_all();
|
||||||
|
m_storage.release();
|
||||||
|
}
|
||||||
|
|
||||||
void torrent::announce_piece(int index)
|
void torrent::announce_piece(int index)
|
||||||
{
|
{
|
||||||
|
@ -829,6 +838,9 @@ namespace libtorrent
|
||||||
// tell the tracker that we stopped
|
// tell the tracker that we stopped
|
||||||
m_event = tracker_request::stopped;
|
m_event = tracker_request::stopped;
|
||||||
m_just_paused = true;
|
m_just_paused = true;
|
||||||
|
// this will make the storage close all
|
||||||
|
// files and flush all cached data
|
||||||
|
if (m_storage.get()) m_storage->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrent::resume()
|
void torrent::resume()
|
||||||
|
|
Loading…
Reference in New Issue