From dd073a324632a7aa9e55d054086d05f04d994d42 Mon Sep 17 00:00:00 2001 From: expressvpn-raihaan-m <98149193+expressvpn-raihaan-m@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:25:28 +0800 Subject: [PATCH 1/5] deps: update libuv to v1.46.0 --- project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.yml b/project.yml index 4794932..6cd75ae 100644 --- a/project.yml +++ b/project.yml @@ -93,7 +93,7 @@ :fetch: :method: :git :source: https://github.com/libuv/libuv.git - :tag: v1.40.0 + :tag: v1.46.0 :build: - "sh autogen.sh" - "./configure --prefix=$(pwd)/../builds/libuv/ --enable-static --disable-shared" From 72935357114bbb812d0d80d678285986bb6b26c6 Mon Sep 17 00:00:00 2001 From: expressvpn-raihaan-m <98149193+expressvpn-raihaan-m@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:25:59 +0800 Subject: [PATCH 2/5] deps: update argparse to v1.1.0 --- project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.yml b/project.yml index 6cd75ae..7520c1d 100644 --- a/project.yml +++ b/project.yml @@ -129,7 +129,7 @@ :fetch: :method: :git :source: https://github.com/cofyc/argparse.git - :tag: v1.0.2 + :tag: v1.1.0 :build: - mkdir -p tidy - cp argparse.c tidy/ From c3745a820ce9735b9de2049d0468d431574b1534 Mon Sep 17 00:00:00 2001 From: expressvpn-raihaan-m <98149193+expressvpn-raihaan-m@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:26:39 +0800 Subject: [PATCH 3/5] deps: update zlog to latest master --- project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.yml b/project.yml index 7520c1d..bb446fd 100644 --- a/project.yml +++ b/project.yml @@ -110,7 +110,7 @@ :fetch: :method: :git :source: https://github.com/zma/zlog.git - :commit: 0f31521 + :commit: 16f266e :build: - mkdir -p tidy - cp zlog.c tidy/ From 19a927201cb77a938f6e30bc2f92017f40a5ecdc Mon Sep 17 00:00:00 2001 From: expressvpn-raihaan-m <98149193+expressvpn-raihaan-m@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:27:43 +0800 Subject: [PATCH 4/5] Flush logs out every second Enables easier debugging --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.c b/src/main.c index 8c7ab7f..3748bb0 100644 --- a/src/main.c +++ b/src/main.c @@ -31,6 +31,8 @@ static const char *const usage[] = { int main(int argc, const char **argv) { // Initialise logging zlog_init_stdout(); + // Flush logs every second + zlog_init_flush_thread_with_interval(1); atexit(zlog_finish); int server = 0; From d5ba7ccfe88548383c4e2b6627ae13952215d07b Mon Sep 17 00:00:00 2001 From: expressvpn-raihaan-m <98149193+expressvpn-raihaan-m@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:31:51 +0800 Subject: [PATCH 5/5] Use strings when logging enums --- src/he/helium.c | 4 ++-- src/udp/flow.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/he/helium.c b/src/he/helium.c index f6e223a..4d40dd7 100644 --- a/src/he/helium.c +++ b/src/he/helium.c @@ -68,7 +68,7 @@ he_return_code_t nudge_time_cb(he_conn_t *client, int timeout, void *context) { } he_return_code_t server_event_cb(he_conn_t *client, he_conn_event_t event, void *context) { - zlogf_time(ZLOG_INFO_LOG_MSG, "Event occurred %d\n", event); + zlogf_time(ZLOG_INFO_LOG_MSG, "Event occurred %s\n", he_client_event_name(event)); return HE_SUCCESS; } @@ -77,7 +77,7 @@ he_return_code_t state_change_cb(he_conn_t *client, he_conn_state_t new_state, v // Get our context back lw_state_t *state = (lw_state_t *)context; - zlogf_time(ZLOG_INFO_LOG_MSG, "State changed %d\n", new_state); + zlogf_time(ZLOG_INFO_LOG_MSG, "State changed to %s\n", he_client_state_name(new_state)); if(new_state == HE_STATE_DISCONNECTED) { zlogf_time(ZLOG_INFO_LOG_MSG, "Helium connection was disconnected\n"); diff --git a/src/udp/flow.c b/src/udp/flow.c index 4767a1c..d5fc88a 100644 --- a/src/udp/flow.c +++ b/src/udp/flow.c @@ -103,7 +103,7 @@ void on_read(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct if(res != HE_SUCCESS) { bool fatal = he_conn_is_error_fatal(state->he_conn, res); - zlogf_time(ZLOG_INFO_LOG_MSG, "Non-zero return code from libhelium: %d Fatal?: %s", res, + zlogf_time(ZLOG_INFO_LOG_MSG, "Non-zero return code from libhelium: %s Fatal?: %s", he_return_code_name(res), fatal ? "true" : "false"); if(fatal) { lw_state_disconnect(state);