fixes for android jni

pull/1610/head
Jeff Becker 3 years ago
parent 380adae39c
commit 6d12a7a712
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -368,7 +368,9 @@ namespace llarp::uv
bool
Loop::inEventLoop() const
{
return m_EventLoopThreadID and *m_EventLoopThreadID == std::this_thread::get_id();
if (m_EventLoopThreadID)
return *m_EventLoopThreadID == std::this_thread::get_id();
return true;
}
} // namespace llarp::uv

@ -498,6 +498,8 @@ namespace llarp::net
{
std::vector<std::string> gateways;
#ifdef __linux__
#ifdef ANDROID
#else
std::ifstream inf("/proc/net/route");
for (std::string line; std::getline(inf, line);)
{
@ -513,7 +515,7 @@ namespace llarp::net
}
}
}
#endif
return gateways;
#elif _WIN32
ForEachWIN32Interface([&](auto w32interface) {

@ -119,7 +119,9 @@ namespace llarp
const auto maybe = GetDefaultGateway();
if (not maybe.has_value())
{
#ifndef ANDROID
LogError("Network is down");
#endif
// mark network lost
m_HasNetwork = false;
return;

Loading…
Cancel
Save