From 5b28964c22723aa0d64fcca38d8dcbc233f4d093 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 16 Aug 2008 21:26:23 +0000 Subject: [PATCH] don't take the ip_interface vector by reference when it's returned by value --- src/enum_net.cpp | 4 ++-- src/upnp.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/enum_net.cpp b/src/enum_net.cpp index eb5a9eeef..ba0e47b7b 100644 --- a/src/enum_net.cpp +++ b/src/enum_net.cpp @@ -230,9 +230,9 @@ namespace libtorrent bool in_local_network(io_service& ios, address const& addr, error_code& ec) { - std::vector const& net = enum_net_interfaces(ios, ec); + std::vector net = enum_net_interfaces(ios, ec); if (ec) return false; - for (std::vector::const_iterator i = net.begin() + for (std::vector::iterator i = net.begin() , end(net.end()); i != end; ++i) { if (in_subnet(addr, *i)) return true; diff --git a/src/upnp.cpp b/src/upnp.cpp index d4cc8a4ca..d98e95284 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -339,7 +339,7 @@ void upnp::on_reply(udp::endpoint const& from, char* buffer { m_log << time_now_string() << " <== (" << from << ") UPnP device " "ignored because it's not on our local network "; - std::vector const& net = enum_net_interfaces(m_io_service, ec); + std::vector net = enum_net_interfaces(m_io_service, ec); for (std::vector::const_iterator i = net.begin() , end(net.end()); i != end; ++i) {