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. 1
      RouterContext.h
  5. 7
      UPnP.cpp
  6. 4
      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:
apt: true apt: true
os: os:
- linux - linux
- osx
sudo: required sudo: required
dist: trusty dist: trusty
addons: addons:

8
NetDb.cpp

@ -71,7 +71,7 @@ namespace data
void NetDb::Run () 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) while (m_IsRunning)
{ {
try try
@ -121,7 +121,11 @@ namespace data
} }
lastSave = ts; 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 we're in hidden mode don't publish or explore
// if (m_HiddenMode) continue; // if (m_HiddenMode) continue;

6
RouterContext.cpp

@ -440,6 +440,12 @@ namespace i2p
i2p::garlic::GarlicDestination::ProcessDeliveryStatusMessage (msg); 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 uint32_t RouterContext::GetUptime () const
{ {
return i2p::util::GetSecondsSinceEpoch () - m_StartupTime; return i2p::util::GetSecondsSinceEpoch () - m_StartupTime;

1
RouterContext.h

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

7
UPnP.cpp

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

4
UPnP.h

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

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

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

10
docs/build_notes_windows.md

@ -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 e.g. C:\dev\miniupnpc . You may want to remove version number from
folder name included in downloaded archive. 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 You can also install it through the MSYS2
and build with USE_UPNP key. and build with USE_UPNP key.
```bash ```bash
pacman -S mingw-w64-i686-miniupnpc 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 ### Creating Visual Studio project

Loading…
Cancel
Save