mirror of https://github.com/oxen-io/lokinet
format
This commit is contained in:
parent
8181670bf3
commit
a5611e2206
|
@ -24,8 +24,7 @@ void iter_main_config(struct llarp_config_iterator *itr, const char *section,
|
|||
}
|
||||
}
|
||||
|
||||
static void progress()
|
||||
{
|
||||
static void progress() {
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -41,11 +40,9 @@ int shutdown_llarp(struct llarp_main *m) {
|
|||
progress();
|
||||
llarp_threadpool_join(m->worker);
|
||||
progress();
|
||||
if(m->logic)
|
||||
llarp_threadpool_wait(m->logic);
|
||||
if (m->logic) llarp_threadpool_wait(m->logic);
|
||||
progress();
|
||||
if(m->logic)
|
||||
llarp_threadpool_join(m->logic);
|
||||
if (m->logic) llarp_threadpool_join(m->logic);
|
||||
progress();
|
||||
llarp_free_router(&m->router);
|
||||
progress();
|
||||
|
@ -55,8 +52,7 @@ int shutdown_llarp(struct llarp_main *m) {
|
|||
progress();
|
||||
llarp_free_threadpool(&m->worker);
|
||||
progress();
|
||||
if(m->logic)
|
||||
llarp_free_threadpool(&m->logic);
|
||||
if (m->logic) llarp_free_threadpool(&m->logic);
|
||||
progress();
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
|
|
|
@ -18,7 +18,8 @@ void llarp_free_router(struct llarp_router **router);
|
|||
bool llarp_configure_router(struct llarp_router *router,
|
||||
struct llarp_config *conf);
|
||||
|
||||
void llarp_run_router(struct llarp_router *router, struct llarp_threadpool * logic);
|
||||
void llarp_run_router(struct llarp_router *router,
|
||||
struct llarp_threadpool *logic);
|
||||
void llarp_stop_router(struct llarp_router *router);
|
||||
|
||||
/** get router's inbound link level frame queue */
|
||||
|
|
|
@ -9,7 +9,7 @@ struct ev_io {
|
|||
char buff[2048];
|
||||
int fd;
|
||||
ev_io(int f) : fd(f){};
|
||||
virtual int read(void * buf, size_t sz) = 0;
|
||||
virtual int read(void* buf, size_t sz) = 0;
|
||||
virtual int sendto(const sockaddr* dst, const void* data, size_t sz) = 0;
|
||||
virtual ~ev_io() { ::close(fd); };
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ struct udp_listener : public ev_io {
|
|||
|
||||
~udp_listener() {}
|
||||
|
||||
virtual int read(void * buf, size_t sz) {
|
||||
virtual int read(void* buf, size_t sz) {
|
||||
sockaddr src;
|
||||
socklen_t slen;
|
||||
int ret = ::recvfrom(fd, buf, sz, 0, &src, &slen);
|
||||
|
|
|
@ -58,7 +58,8 @@ bool llarp_configure_router(struct llarp_router *router,
|
|||
return router->Ready();
|
||||
}
|
||||
|
||||
void llarp_run_router(struct llarp_router *router, struct llarp_threadpool * logic) {
|
||||
void llarp_run_router(struct llarp_router *router,
|
||||
struct llarp_threadpool *logic) {
|
||||
router->ForEachLink([logic](llarp_link *link) {
|
||||
int result = link->start_link(link, logic);
|
||||
if (result == -1) printf("link %s failed to start\n", link->name(link));
|
||||
|
|
Loading…
Reference in New Issue