Blob Blame History Raw
From 6968a8b8c48a63af8c813ed47652662cbce837be Mon Sep 17 00:00:00 2001
From: Andrew Beekhof <andrew@beekhof.net>
Date: Thu, 7 Jan 2016 11:28:14 +1100
Subject: [PATCH] Fix: attrd: Hook up the client name so we can track requests

---
 attrd/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/attrd/main.c b/attrd/main.c
index 069e9fa..0198396 100644
--- a/attrd/main.c
+++ b/attrd/main.c
@@ -226,6 +226,11 @@ attrd_ipc_dispatch(qb_ipcs_connection_t * c, void *data, size_t size)
 
     op = crm_element_value(xml, F_ATTRD_TASK);
 
+    if (client->name == NULL) {
+        const char *value = crm_element_value(xml, F_ORIG);
+        client->name = crm_strdup_printf("%s.%d", value?value:"unknown", client->pid);
+    }
+
     if (safe_str_eq(op, ATTRD_OP_PEER_REMOVE)) {
         attrd_send_ack(client, id, flags);
         attrd_client_peer_remove(client->name, xml);
-- 
1.8.3.1