mirror of https://github.com/oxen-io/lokinet
clang-format
This commit is contained in:
parent
5cef16e7cf
commit
f6c97091fd
|
@ -16,7 +16,8 @@
|
|||
#ifdef _WIN32
|
||||
#define wmin(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#define MIN wmin
|
||||
extern "C" LONG FAR PASCAL win32_signal_handler(EXCEPTION_POINTERS*);
|
||||
extern "C" LONG FAR PASCAL
|
||||
win32_signal_handler(EXCEPTION_POINTERS *);
|
||||
#endif
|
||||
|
||||
struct llarp_main *ctx = 0;
|
||||
|
@ -117,7 +118,7 @@ main(int argc, char *argv[])
|
|||
if(startWinsock())
|
||||
return -1;
|
||||
SetConsoleCtrlHandler(handle_signal_win32, TRUE);
|
||||
//SetUnhandledExceptionFilter(win32_signal_handler);
|
||||
// SetUnhandledExceptionFilter(win32_signal_handler);
|
||||
#endif
|
||||
|
||||
#ifdef LOKINET_DEBUG
|
||||
|
|
|
@ -631,17 +631,16 @@ namespace libuv
|
|||
Loop::CloseAll()
|
||||
{
|
||||
llarp::LogInfo("Closing all handles");
|
||||
uv_walk(
|
||||
m_Impl.get(),
|
||||
[](uv_handle_t* h, void*) {
|
||||
if(uv_is_closing(h))
|
||||
return;
|
||||
if(h->data && uv_is_active(h))
|
||||
{
|
||||
static_cast< glue* >(h->data)->Close();
|
||||
}
|
||||
},
|
||||
nullptr);
|
||||
uv_walk(m_Impl.get(),
|
||||
[](uv_handle_t* h, void*) {
|
||||
if(uv_is_closing(h))
|
||||
return;
|
||||
if(h->data && uv_is_active(h))
|
||||
{
|
||||
static_cast< glue* >(h->data)->Close();
|
||||
}
|
||||
},
|
||||
nullptr);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -368,12 +368,12 @@ namespace llarp
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
UDPSendTo(llarp_udp_io* udp, const sockaddr* to, const byte_t* ptr, size_t sz)
|
||||
{
|
||||
llarp::ev_io* io = (llarp::ev_io*)udp->impl;
|
||||
return io->sendto(to, ptr, sz);
|
||||
}
|
||||
static int
|
||||
UDPSendTo(llarp_udp_io* udp, const sockaddr* to, const byte_t* ptr, size_t sz)
|
||||
{
|
||||
llarp::ev_io* io = (llarp::ev_io*)udp->impl;
|
||||
return io->sendto(to, ptr, sz);
|
||||
}
|
||||
|
||||
int
|
||||
udp_listener::sendto(const sockaddr* to, const void* data, size_t sz)
|
||||
|
@ -641,7 +641,7 @@ llarp_win32_loop::create_udp(llarp_udp_io* l, const sockaddr* src)
|
|||
return nullptr;
|
||||
llarp::ev_io* listener = new llarp::udp_listener(fd, l);
|
||||
l->impl = listener;
|
||||
l->sendto = &UDPSendTo;
|
||||
l->sendto = &UDPSendTo;
|
||||
return listener;
|
||||
}
|
||||
|
||||
|
|
|
@ -295,10 +295,9 @@ namespace llarp
|
|||
PathSet::HandlePathBuildFailed(Path_ptr p)
|
||||
{
|
||||
LogWarn(Name(), " path build ", p->HopsString(), " failed");
|
||||
m_BuildStats.fails ++;
|
||||
m_BuildStats.fails++;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PathSet::PathBuildStarted(Path_ptr p)
|
||||
{
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _MSC_VER
|
||||
#include <windows.h>
|
||||
extern "C" void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName);
|
||||
extern "C" void
|
||||
SetThreadName(DWORD dwThreadID, LPCSTR szThreadName);
|
||||
#endif
|
||||
|
||||
namespace llarp
|
||||
|
@ -29,7 +30,7 @@ namespace llarp
|
|||
#if defined(__MACH__)
|
||||
const int rc = pthread_setname_np(name.c_str());
|
||||
// API present upstream since v2.11.3 and imported downstream
|
||||
// in CR 8158 <https://www.illumos.org/issues/8158>
|
||||
// in CR 8158 <https://www.illumos.org/issues/8158>
|
||||
// We only use the native function on Microsoft C++ builds
|
||||
#elif defined(__linux__) || defined(__sun) || defined(__MINGW32__)
|
||||
const int rc = pthread_setname_np(pthread_self(), name.c_str());
|
||||
|
|
|
@ -332,9 +332,7 @@ namespace llarp
|
|||
{
|
||||
LogWarn("dropping inbound utp session from ", remote);
|
||||
// close later
|
||||
self->m_Logic->call_later(50, [=]() {
|
||||
session->Close();
|
||||
});
|
||||
self->m_Logic->call_later(50, [=]() { session->Close(); });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue