Browse Source

Merge remote-tracking branch 'purple/openssl'

pull/628/head
Jeff Becker 8 years ago
parent
commit
070a21a9eb
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 1
      .travis.yml
  2. 8
      NetDb.cpp
  3. 6
      RouterContext.cpp
  4. 3
      RouterContext.h
  5. 9
      UPnP.cpp
  6. 6
      UPnP.h
  7. 5
      debian/patches/01-tune-build-opts.patch
  8. 10
      docs/build_notes_windows.md

1
.travis.yml

@ -3,7 +3,6 @@ cache: @@ -3,7 +3,6 @@ cache:
apt: true
os:
- linux
- osx
sudo: required
dist: trusty
addons:

8
NetDb.cpp

@ -71,7 +71,7 @@ namespace data @@ -71,7 +71,7 @@ namespace data
void NetDb::Run ()
{
uint32_t lastSave = 0, lastPublish = 0, lastExploratory = 0, lastManageRequest = 0;
uint32_t lastSave = 0, lastPublish = 0, lastExploratory = 0, lastManageRequest = 0, lastDestinationCleanup = 0;
while (m_IsRunning)
{
try
@ -121,7 +121,11 @@ namespace data @@ -121,7 +121,11 @@ namespace data
}
lastSave = ts;
}
if (ts - lastDestinationCleanup >= i2p::garlic::INCOMING_TAGS_EXPIRATION_TIMEOUT)
{
i2p::context.CleanupDestination ();
lastDestinationCleanup = ts;
}
// if we're in hidden mode don't publish or explore
// if (m_HiddenMode) continue;

6
RouterContext.cpp

@ -439,6 +439,12 @@ namespace i2p @@ -439,6 +439,12 @@ namespace i2p
std::unique_lock<std::mutex> l(m_GarlicMutex);
i2p::garlic::GarlicDestination::ProcessDeliveryStatusMessage (msg);
}
void RouterContext::CleanupDestination ()
{
std::unique_lock<std::mutex> l(m_GarlicMutex);
i2p::garlic::GarlicDestination::CleanupExpiredTags ();
}
uint32_t RouterContext::GetUptime () const
{

3
RouterContext.h

@ -71,7 +71,8 @@ namespace i2p @@ -71,7 +71,8 @@ namespace i2p
void SetSupportsV4 (bool supportsV4);
void UpdateNTCPV6Address (const boost::asio::ip::address& host); // called from NTCP session
void UpdateStats ();
void UpdateStats ();
void CleanupDestination (); // garlic destination
// implements LocalDestination
std::shared_ptr<const i2p::data::IdentityEx> GetIdentity () const { return m_Keys.GetPublic (); };

9
UPnP.cpp

@ -49,7 +49,9 @@ namespace transport @@ -49,7 +49,9 @@ namespace transport
m_IsRunning = true;
LogPrint(eLogInfo, "UPnP: starting");
m_Service.post (std::bind (&UPnP::Discover, this));
std::unique_lock<std::mutex> l(m_StartedMutex);
m_Thread.reset (new std::thread (std::bind (&UPnP::Run, this)));
m_Started.wait_for (l, std::chrono::seconds (5)); // 5 seconds maximum
}
UPnP::~UPnP ()
@ -80,7 +82,12 @@ namespace transport @@ -80,7 +82,12 @@ namespace transport
#else
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror);
#endif
{
// notify satrting thread
std::unique_lock<std::mutex> l(m_StartedMutex);
m_Started.notify_all ();
}
int r;
r = UPNP_GetValidIGD (m_Devlist, &m_upnpUrls, &m_upnpData, m_NetworkAddr, sizeof (m_NetworkAddr));
if (r == 1)

6
UPnP.h

@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
#ifdef USE_UPNP
#include <string>
#include <thread>
#include <condition_variable>
#include <mutex>
#include <memory>
#include <miniupnpc/miniwget.h>
@ -43,8 +45,10 @@ namespace transport @@ -43,8 +45,10 @@ namespace transport
bool m_IsRunning;
std::unique_ptr<std::thread> m_Thread;
std::condition_variable m_Started;
std::mutex m_StartedMutex;
boost::asio::io_service m_Service;
boost::asio::deadline_timer m_Timer;
boost::asio::deadline_timer m_Timer;
struct UPNPUrls m_upnpUrls;
struct IGDdatas m_upnpData;

5
debian/patches/01-tune-build-opts.patch vendored

@ -1,14 +1,15 @@ @@ -1,14 +1,15 @@
diff --git a/Makefile b/Makefile
index fe8ae7e..fc8abda 100644
index 7d04ba0..33ee184 100644
--- a/Makefile
+++ b/Makefile
@@ -9,9 +9,9 @@ DEPS := obj/make.dep
@@ -9,10 +9,10 @@ DEPS := obj/make.dep
include filelist.mk
-USE_AESNI := yes
+USE_AESNI := no
USE_STATIC := no
USE_MESHNET := no
-USE_UPNP := no
+USE_UPNP := yes

10
docs/build_notes_windows.md

@ -161,15 +161,17 @@ support for this. Unpack client source code in a sibling folder, @@ -161,15 +161,17 @@ support for this. Unpack client source code in a sibling folder,
e.g. C:\dev\miniupnpc . You may want to remove version number from
folder name included in downloaded archive.
Note that you might need to build DLL yourself for 64-bit systems
using msys2 as 64-bit DLLs are not provided by the project.
You can also install it through the MSYS2
and build with USE_UPNP key.
```bash
pacman -S mingw-w64-i686-miniupnpc
make USE_UPNP=1
make USE_UPNP=yes
```
or
```bash
pacman -S mingw-x86_64-miniupnpc
make USE_UPNP=yes
```
### Creating Visual Studio project

Loading…
Cancel
Save