mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
Crash fix
This commit is contained in:
parent
378bc73bf8
commit
ac808d51d6
2 changed files with 3 additions and 2 deletions
|
@ -156,7 +156,7 @@ void Peer::received(
|
||||||
Mutex::Lock ltl(_lastTriedPath_m);
|
Mutex::Lock ltl(_lastTriedPath_m);
|
||||||
|
|
||||||
bool triedTooRecently = false;
|
bool triedTooRecently = false;
|
||||||
for(std::vector< std::pair< Path *, int64_t > >::iterator i(_lastTriedPath.begin());i!=_lastTriedPath.end();) {
|
for(std::list< std::pair< Path *, int64_t > >::iterator i(_lastTriedPath.begin());i!=_lastTriedPath.end();) {
|
||||||
if ((now - i->second) > 1000) {
|
if ((now - i->second) > 1000) {
|
||||||
_lastTriedPath.erase(i++);
|
_lastTriedPath.erase(i++);
|
||||||
} else if (i->first == path.ptr()) {
|
} else if (i->first == path.ptr()) {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#define ZT_PEER_HPP
|
#define ZT_PEER_HPP
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
#include "../include/ZeroTierOne.h"
|
#include "../include/ZeroTierOne.h"
|
||||||
|
|
||||||
|
@ -573,7 +574,7 @@ private:
|
||||||
uint16_t _vMinor;
|
uint16_t _vMinor;
|
||||||
uint16_t _vRevision;
|
uint16_t _vRevision;
|
||||||
|
|
||||||
std::vector< std::pair< Path *, int64_t > > _lastTriedPath;
|
std::list< std::pair< Path *, int64_t > > _lastTriedPath;
|
||||||
Mutex _lastTriedPath_m;
|
Mutex _lastTriedPath_m;
|
||||||
|
|
||||||
_PeerPath _paths[ZT_MAX_PEER_NETWORK_PATHS];
|
_PeerPath _paths[ZT_MAX_PEER_NETWORK_PATHS];
|
||||||
|
|
Loading…
Add table
Reference in a new issue