summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-04-04 08:56:12 +0200
committerThomas Haller <thaller@redhat.com>2023-04-04 08:58:06 +0200
commit3a76d717dab30e525ff7e451bd8418ebba9c7afc (patch)
treed103dd04b10b1d745abc8f5f5e2ba6a715d95f26
parent0ee60b943d07dcbbc8507e346175bac9bb49bd6d (diff)
downloadNetworkManager-3a76d717dab30e525ff7e451bd8418ebba9c7afc.tar.gz
ovsdb: debug log all messages of socket buffer
-rw-r--r--src/core/devices/ovs/nm-ovsdb.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/devices/ovs/nm-ovsdb.c b/src/core/devices/ovs/nm-ovsdb.c
index 8c463106fd..68366f7398 100644
--- a/src/core/devices/ovs/nm-ovsdb.c
+++ b/src/core/devices/ovs/nm-ovsdb.c
@@ -2199,6 +2199,9 @@ ovsdb_got_echo(NMOvsdb *self, json_int_t id, json_t *data)
msg = json_pack("{s:I, s:O}", "id", id, "result", data);
reply = json_dumps(msg, 0);
+
+ _LOGT("send: echo: %s", reply);
+
nm_str_buf_append(&priv->output_buf, reply);
ovsdb_write_try(self);
@@ -2348,8 +2351,9 @@ _json_read_msg_cb(void *buffer, size_t buflen, void *user_data)
}
static json_t *
-_json_read_msg(NMStrBuf *input)
+_json_read_msg(NMOvsdb *self, NMStrBuf *input)
{
+ gs_free char *ss = NULL;
JsonReadMsgData data = {
.bufp = 0,
.input = input,
@@ -2367,6 +2371,11 @@ _json_read_msg(NMStrBuf *input)
return NULL;
nm_assert(data.bufp > 0);
+
+ _LOGT("json: parse %zu bytes: \"%s\"",
+ data.bufp,
+ (ss = g_strndup(nm_str_buf_get_str_at_unsafe(input, 0), data.bufp)));
+
nm_str_buf_erase(input, 0, data.bufp, FALSE);
return msg;
}
@@ -2419,7 +2428,7 @@ again:
while (TRUE) {
nm_auto_decref_json json_t *msg = NULL;
- msg = _json_read_msg(&priv->input_buf);
+ msg = _json_read_msg(self, &priv->input_buf);
if (!msg)
break;