forked from premiere/premiere-libtorrent
avoid calling address to test protocol, more consts and minor lint oriented code changes
This commit is contained in:
parent
f963f2c726
commit
1f06a6684c
|
@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#define TORRENT_STORAGE_UTILS_HPP_INCLUDE
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "libtorrent/config.hpp"
|
||||
#include "libtorrent/span.hpp"
|
||||
|
@ -86,7 +87,7 @@ namespace aux {
|
|||
// opt to only delete the partfile
|
||||
TORRENT_EXTRA_EXPORT void
|
||||
delete_files(file_storage const& fs, std::string const& save_path
|
||||
, std::string const& part_file_name, remove_flags_t const options, storage_error& ec);
|
||||
, std::string const& part_file_name, remove_flags_t options, storage_error& ec);
|
||||
|
||||
TORRENT_EXTRA_EXPORT bool
|
||||
verify_resume_data(add_torrent_params const& rd
|
||||
|
|
|
@ -40,7 +40,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "libtorrent/add_torrent_params.hpp"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
namespace libtorrent { namespace aux {
|
||||
|
||||
|
@ -173,9 +172,9 @@ namespace libtorrent { namespace aux {
|
|||
|
||||
// make a copy of the iovec array that _just_ covers the next
|
||||
// file_bytes_left bytes, i.e. just this one operation
|
||||
int tmp_bufs_used = copy_bufs(current_buf, file_bytes_left, tmp_buf);
|
||||
int const tmp_bufs_used = copy_bufs(current_buf, file_bytes_left, tmp_buf);
|
||||
|
||||
int bytes_transferred = op(file_index, file_offset
|
||||
int const bytes_transferred = op(file_index, file_offset
|
||||
, tmp_buf.first(tmp_bufs_used), ec);
|
||||
if (ec) return -1;
|
||||
|
||||
|
@ -265,7 +264,7 @@ namespace libtorrent { namespace aux {
|
|||
// later
|
||||
aux::vector<bool, file_index_t> copied_files(std::size_t(f.num_files()), false);
|
||||
|
||||
file_index_t i;
|
||||
file_index_t i{};
|
||||
error_code e;
|
||||
for (i = file_index_t(0); i < f.end_file(); ++i)
|
||||
{
|
||||
|
|
|
@ -649,12 +649,12 @@ namespace libtorrent {
|
|||
}
|
||||
|
||||
#if TORRENT_USE_IPV6
|
||||
if (m_target.address().is_v6())
|
||||
if (m_target.protocol() == udp::v6())
|
||||
{
|
||||
resp.peers6.reserve(std::size_t(num_peers));
|
||||
for (int i = 0; i < num_peers; ++i)
|
||||
{
|
||||
ipv6_peer_entry e;
|
||||
ipv6_peer_entry e{};
|
||||
std::memcpy(e.ip.data(), buf.data(), 16);
|
||||
buf = buf.subspan(16);
|
||||
e.port = aux::read_uint16(buf);
|
||||
|
@ -667,7 +667,7 @@ namespace libtorrent {
|
|||
resp.peers4.reserve(std::size_t(num_peers));
|
||||
for (int i = 0; i < num_peers; ++i)
|
||||
{
|
||||
ipv4_peer_entry e;
|
||||
ipv4_peer_entry e{};
|
||||
std::memcpy(e.ip.data(), buf.data(), 4);
|
||||
buf = buf.subspan(4);
|
||||
e.port = aux::read_uint16(buf);
|
||||
|
|
Loading…
Reference in New Issue