mirror of https://github.com/oxen-io/lokinet
fixes for android jni
This commit is contained in:
parent
380adae39c
commit
6d12a7a712
|
@ -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…
Reference in New Issue