use random() instead of rand()
This commit is contained in:
@@ -760,7 +760,7 @@ namespace libtorrent
|
||||
// in anonymous mode, every peer connection
|
||||
// has a unique peer-id
|
||||
for (int i = 0; i < 20; ++i)
|
||||
*ptr++ = rand();
|
||||
*ptr++ = random();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -39,6 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include <libtorrent/io.hpp>
|
||||
#include <libtorrent/random.hpp>
|
||||
#include <libtorrent/invariant_check.hpp>
|
||||
#include <libtorrent/kademlia/node_id.hpp> // for generate_random_id
|
||||
#include <libtorrent/kademlia/rpc_manager.hpp>
|
||||
@@ -463,7 +464,7 @@ bool rpc_manager::invoke(entry& e, udp::endpoint target_addr
|
||||
std::string transaction_id;
|
||||
transaction_id.resize(2);
|
||||
char* out = &transaction_id[0];
|
||||
int tid = rand() ^ (rand() << 5);
|
||||
int tid = random() ^ (random() << 5);
|
||||
io::write_uint16(tid, out);
|
||||
e["t"] = transaction_id;
|
||||
|
||||
|
Reference in New Issue
Block a user