Merge remote-tracking branch 'purple/openssl'

This commit is contained in:
Jeff Becker 2016-12-07 09:34:33 -05:00
commit d1b154c285
9 changed files with 35 additions and 45 deletions

View File

@ -1,6 +1,11 @@
# for this file format description, # for this file format description,
# see https://github.com/olivierlacan/keep-a-changelog # see https://github.com/olivierlacan/keep-a-changelog
## [2.10.2] - 2016-12-04
### Fixed
- Fixes UPnP discovery bug, producing excessive CPU usage
- Fixes sudden SSU thread stop for Windows.
## [2.10.1] - 2016-11-07 ## [2.10.1] - 2016-11-07
### Fixed ### Fixed
- Fixed some performance issues for Windows and Android - Fixed some performance issues for Windows and Android

View File

@ -118,7 +118,6 @@ namespace data
{ {
SaveUpdated (); SaveUpdated ();
ManageLeaseSets (); ManageLeaseSets ();
ManageLookupResponses ();
} }
lastSave = ts; lastSave = ts;
} }
@ -857,33 +856,17 @@ namespace data
} }
if (!replyMsg) if (!replyMsg)
{ {
LogPrint (eLogWarning, "NetDb: Requested ", key, " not found, ", numExcluded, " peers excluded"); std::set<IdentHash> excludedRouters;
// find or cleate response const uint8_t * exclude_ident = excluded;
std::vector<IdentHash> closestFloodfills; for (int i = 0; i < numExcluded; i++)
bool found = false; {
if (!numExcluded) excludedRouters.insert (exclude_ident);
{ exclude_ident += 32;
auto it = m_LookupResponses.find (ident);
if (it != m_LookupResponses.end ())
{
closestFloodfills = it->second.first;
found = true;
}
}
if (!found)
{
std::set<IdentHash> excludedRouters;
const uint8_t * exclude_ident = excluded;
for (int i = 0; i < numExcluded; i++)
{
excludedRouters.insert (exclude_ident);
exclude_ident += 32;
}
closestFloodfills = GetClosestFloodfills (ident, 3, excludedRouters, true);
if (!numExcluded) // save if no excluded
m_LookupResponses[ident] = std::make_pair(closestFloodfills, i2p::util::GetSecondsSinceEpoch ());
} }
auto closestFloodfills = GetClosestFloodfills (ident, 3, excludedRouters, true);
if (closestFloodfills.empty ())
LogPrint (eLogWarning, "NetDb: Requested ", key, " not found, ", numExcluded, " peers excluded");
replyMsg = CreateDatabaseSearchReply (ident, closestFloodfills); replyMsg = CreateDatabaseSearchReply (ident, closestFloodfills);
} }
} }
@ -1191,17 +1174,5 @@ namespace data
++it; ++it;
} }
} }
void NetDb::ManageLookupResponses ()
{
auto ts = i2p::util::GetSecondsSinceEpoch ();
for (auto it = m_LookupResponses.begin (); it != m_LookupResponses.end ();)
{
if (ts > it->second.second + 180) // 3 minutes
it = m_LookupResponses.erase (it);
else
++it;
}
}
} }
} }

View File

@ -112,7 +112,6 @@ namespace data
void Publish (); void Publish ();
void ManageLeaseSets (); void ManageLeaseSets ();
void ManageRequests (); void ManageRequests ();
void ManageLookupResponses ();
void ReseedFromFloodfill(const RouterInfo & ri, int numRouters=40, int numFloodfills=20); void ReseedFromFloodfill(const RouterInfo & ri, int numRouters=40, int numFloodfills=20);
@ -143,8 +142,7 @@ namespace data
/** router info we are bootstrapping from or nullptr if we are not currently doing that*/ /** router info we are bootstrapping from or nullptr if we are not currently doing that*/
std::shared_ptr<RouterInfo> m_FloodfillBootstrap; std::shared_ptr<RouterInfo> m_FloodfillBootstrap;
std::map<IdentHash, std::pair<std::vector<IdentHash>, uint64_t> > m_LookupResponses; // ident->(closest FFs, timestamp)
/** true if in hidden mode */ /** true if in hidden mode */
bool m_HiddenMode; bool m_HiddenMode;

View File

@ -116,6 +116,7 @@ namespace tunnel
if (!isFollowOnFragment) // create new incomlete message if (!isFollowOnFragment) // create new incomlete message
{ {
m.nextFragmentNum = 1; m.nextFragmentNum = 1;
m.receiveTime = i2p::util::GetMillisecondsSinceEpoch ();
auto ret = m_IncompleteMessages.insert (std::pair<uint32_t, TunnelMessageBlockEx>(msgID, m)); auto ret = m_IncompleteMessages.insert (std::pair<uint32_t, TunnelMessageBlockEx>(msgID, m));
if (ret.second) if (ret.second)
HandleOutOfSequenceFragments (msgID, ret.first->second); HandleOutOfSequenceFragments (msgID, ret.first->second);
@ -284,6 +285,14 @@ namespace tunnel
else else
++it; ++it;
} }
// incomplete messages
for (auto it = m_IncompleteMessages.begin (); it != m_IncompleteMessages.end ();)
{
if (ts > it->second.receiveTime + i2p::I2NP_MESSAGE_EXPIRATION_TIMEOUT)
it = m_IncompleteMessages.erase (it);
else
++it;
}
} }
} }
} }

View File

@ -15,6 +15,7 @@ namespace tunnel
{ {
struct TunnelMessageBlockEx: public TunnelMessageBlock struct TunnelMessageBlockEx: public TunnelMessageBlock
{ {
uint64_t receiveTime; // milliseconds since epoch
uint8_t nextFragmentNum; uint8_t nextFragmentNum;
}; };

View File

@ -1,5 +1,5 @@
#define I2Pd_AppName "i2pd" #define I2Pd_AppName "i2pd"
#define I2Pd_ver "2.10.1" #define I2Pd_ver "2.10.2"
#define I2Pd_Publisher "PurpleI2P" #define I2Pd_Publisher "PurpleI2P"
[Setup] [Setup]

View File

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.purplei2p.i2pd" package="org.purplei2p.i2pd"
android:versionCode="1" android:versionCode="1"
android:versionName="2.10.1"> android:versionName="2.10.2">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="24"/> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="24"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
i2pd (2.10.2-1) unstable; urgency=low
* updated to version 2.10.2
-- orignal <orignal@i2pmail.org> Sun, 4 Dec 2016 19:38:30 +0000
i2pd (2.10.1-1) unstable; urgency=low i2pd (2.10.1-1) unstable; urgency=low
* updated to version 2.10.1 * updated to version 2.10.1

View File

@ -8,7 +8,7 @@
#define I2PD_VERSION_MAJOR 2 #define I2PD_VERSION_MAJOR 2
#define I2PD_VERSION_MINOR 10 #define I2PD_VERSION_MINOR 10
#define I2PD_VERSION_MICRO 1 #define I2PD_VERSION_MICRO 2
#define I2PD_VERSION_PATCH 0 #define I2PD_VERSION_PATCH 0
#define I2PD_VERSION MAKE_VERSION(I2PD_VERSION_MAJOR, I2PD_VERSION_MINOR, I2PD_VERSION_MICRO) #define I2PD_VERSION MAKE_VERSION(I2PD_VERSION_MAJOR, I2PD_VERSION_MINOR, I2PD_VERSION_MICRO)
#define VERSION I2PD_VERSION #define VERSION I2PD_VERSION