mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 00:20:46 +00:00 
			
		
		
		
	terminate sessions if clock was adjusted backwards too much
This commit is contained in:
		
							parent
							
								
									aac9a8d18f
								
							
						
					
					
						commit
						993900aa77
					
				
					 2 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -175,7 +175,8 @@ namespace data
 | 
			
		|||
	{
 | 
			
		||||
		if (!m_LastDeclineTime) return false;
 | 
			
		||||
		auto ts = i2p::util::GetSecondsSinceEpoch ();
 | 
			
		||||
		if (ts > m_LastDeclineTime + PEER_PROFILE_DECLINED_RECENTLY_INTERVAL)
 | 
			
		||||
		if (ts > m_LastDeclineTime + PEER_PROFILE_DECLINED_RECENTLY_INTERVAL ||
 | 
			
		||||
		    ts + PEER_PROFILE_DECLINED_RECENTLY_INTERVAL < m_LastDeclineTime)
 | 
			
		||||
			m_LastDeclineTime = 0;
 | 
			
		||||
		return (bool)m_LastDeclineTime;
 | 
			
		||||
	}	
 | 
			
		||||
| 
						 | 
				
			
			@ -200,7 +201,8 @@ namespace data
 | 
			
		|||
	{
 | 
			
		||||
		if (!m_LastUnreachableTime) return false;
 | 
			
		||||
		auto ts = i2p::util::GetSecondsSinceEpoch ();
 | 
			
		||||
		if (ts > m_LastUnreachableTime + PEER_PROFILE_UNREACHABLE_INTERVAL)
 | 
			
		||||
		if (ts > m_LastUnreachableTime + PEER_PROFILE_UNREACHABLE_INTERVAL ||
 | 
			
		||||
		    ts + PEER_PROFILE_UNREACHABLE_INTERVAL < m_LastUnreachableTime)
 | 
			
		||||
			m_LastUnreachableTime = 0;
 | 
			
		||||
		return (bool)m_LastUnreachableTime;
 | 
			
		||||
	}	
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue