From 41878a587f3c2ffc55448137d1cc72f835fb8bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Wed, 7 Sep 2022 03:41:28 +0200 Subject: xC: use liberty logging less These messages cannot be relayed to frontends (they could be, but it's useful to keep them distinct rather than redirected). --- xC.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xC.c') diff --git a/xC.c b/xC.c index d65e85a..e35cfc6 100644 --- a/xC.c +++ b/xC.c @@ -2868,6 +2868,7 @@ relay_try_fetch_client (struct app_context *ctx, int listen_fd) if (accept_error_is_transient (errno)) print_warning ("%s: %s", "accept", strerror (errno)); else + // TODO: Rather dispose of the listening socket. print_fatal ("%s: %s", "accept", strerror (errno)); return true; } @@ -14760,7 +14761,8 @@ try_reap_child (struct app_context *ctx) if (WIFSTOPPED (status)) { // We could also send SIGCONT but what's the point - print_debug ("a child has been stopped, killing its process group"); + log_global_debug (ctx, + "A child has been stopped, killing its process group"); kill (-zombie, SIGKILL); return true; } @@ -15258,7 +15260,7 @@ client_process_message (struct client *c, if (!relay_command_message_deserialize (m, r) || msg_unpacker_get_available (r)) { - print_error ("deserialization failed, killing client"); + log_global_error (c->ctx, "Deserialization failed, killing client"); return false; } @@ -15277,7 +15279,8 @@ client_process_message (struct client *c, if (m->data.hello.version != RELAY_VERSION) { // TODO: This should send back an error message and shut down. - print_error ("protocol version mismatch, killing client"); + log_global_error (c->ctx, + "Protocol version mismatch, killing client"); return false; } c->initialized = true; @@ -15305,7 +15308,7 @@ client_process_message (struct client *c, client_process_buffer_log (c, m->command_seq, buffer); break; default: - print_warning ("unhandled client command"); + log_global_debug (c->ctx, "Unhandled client command"); relay_prepare_error (c->ctx, m->command_seq, "Unknown command"); relay_send (c); } -- cgit v1.2.3