lib/util Bring procid_str() into lib/util as server_id_string() merge-server_id
authorAndrew Bartlett <abartlet@samba.org>
Wed, 8 Jun 2011 04:05:55 +0000 (14:05 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 8 Jun 2011 04:49:31 +0000 (14:49 +1000)
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett

22 files changed:
lib/util/server_id.c [new file with mode: 0644]
lib/util/util.h
lib/util/wscript_build
librpc/idl/server_id.idl
source3/Makefile.in
source3/include/messages.h
source3/include/proto.h
source3/lib/g_lock.c
source3/lib/util.c
source3/locking/brlock.c
source3/smbd/oplock.c
source3/smbd/sesssetup.c
source3/utils/net_g_lock.c
source3/utils/net_serverid.c
source3/utils/smbcontrol.c
source4/cluster/cluster.c
source4/cluster/cluster.h
source4/cluster/cluster_private.h
source4/cluster/local.c
source4/lib/messaging/messaging.c
source4/smb_server/smb/receive.c
source4/smbd/service_stream.c

diff --git a/lib/util/server_id.c b/lib/util/server_id.c
new file mode 100644 (file)
index 0000000..3497c7e
--- /dev/null
@@ -0,0 +1,41 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+   Copyright (C) Andrew Tridgell 1992-1998
+   Copyright (C) Jeremy Allison 2001-2007
+   Copyright (C) Simo Sorce 2001
+   Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
+   Copyright (C) James Peach 2006
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "librpc/gen_ndr/server_id.h"
+
+char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id)
+{
+       if (id->vnn == NONCLUSTER_VNN && id->task_id == 0) {
+               return talloc_asprintf(mem_ctx,
+                                      "%llu",
+                                      (unsigned long long)id->pid);
+       } else {
+               return talloc_asprintf(mem_ctx,
+                                      "%u:%llu:%u",
+                                      (unsigned)id->vnn,
+                                      (unsigned long long)id->pid,
+                                      (unsigned)id->task_id);
+       }
+}
+
index e89c4ac9977e4771931787c622c9a19fe33bfc7b..e50cc38a2f66cc56d3b37cdd41ff9b2f835f54e6 100644 (file)
@@ -916,5 +916,7 @@ char *data_path(TALLOC_CTX *mem_ctx, const char *name);
  **/
 const char *shlib_ext(void);
 
+struct server_id;
+char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id);
 
 #endif /* _SAMBA_UTIL_H_ */
index 8ce30eb689119e1d1165dff3299dfd63bfaaefc9..6c4bb37884d820af5a68ca5016b48dcd7ac19abf 100755 (executable)
@@ -5,7 +5,8 @@ common_util_sources = '''talloc_stack.c smb_threads.c xfile.c data_blob.c
                     genrand.c fsusage.c blocking.c become_daemon.c
                     signal.c system.c params.c util.c util_id.c util_net.c
                     util_strlist.c util_paths.c idtree.c debug.c fault.c base64.c
-                    util_str.c util_str_common.c substitute.c ms_fnmatch.c'''
+                    util_str.c util_str_common.c substitute.c ms_fnmatch.c
+                    server_id.c'''
 
 common_util_headers = 'debug.h'
 common_util_public_deps = 'talloc pthread LIBCRYPTO CHARSET'
index 51900000edb0b5ed77c08d3e4c1ca7bc2330e038..ff2a5238662c7257ae3b82abef0a43b209e30489 100644 (file)
@@ -4,6 +4,13 @@
 interface server_id
 {
 
+       /*
+        * Virtual Node Numbers are identifying a node within a cluster. 
+        * Ctdbd sets this, we retrieve our vnn from it.
+        */
+
+       const int NONCLUSTER_VNN = 0xFFFFFFFF;
+
        /* used to look like the following, note that unique_id was not
         * marshalled at all...
 
index 8165d2585c06c0d0daa9c18bb6f2bb52e3c875bb..5877ecfa212e1a610371e896a641c83733e026d3 100644 (file)
@@ -429,7 +429,7 @@ UTIL_OBJ = ../lib/util/rbtree.o ../lib/util/signal.o ../lib/util/time.o \
                   ../lib/util/tevent_werror.o \
                   ../lib/util/smb_threads.o ../lib/util/util_id.o \
                   ../lib/util/blocking.o ../lib/util/rfc1738.o \
-                  ../lib/util/select.o ../lib/util/util_pw.o
+                  ../lib/util/select.o ../lib/util/util_pw.o ../lib/util/util_server_id.o
 
 CRYPTO_OBJ = ../lib/crypto/crc32.o ../lib/crypto/md5.o \
                         ../lib/crypto/hmacmd5.o ../lib/crypto/arcfour.o \
index a78599055d26eb9b18fba09ec4e80cb809ac3a0c..41d5bb19fdb29a376604ce6322a19ae8227e2921 100644 (file)
 #define FLAG_MSG_DBWRAP                        0x0020
 
 
-/*
- * Virtual Node Numbers are identifying a node within a cluster. Ctdbd sets
- * this, we retrieve our vnn from it.
- */
-
-#define NONCLUSTER_VNN (0xFFFFFFFF)
-
 /*
  * ctdb gives us 64-bit server ids for messaging_send. This is done to avoid
  * pid clashes and to be able to register for special messages like "all
index 10a84f90509a43ca76338ccdad29e6de6f9524de..2c6106e8391addab0d011ea81b81274553ea5a5e 100644 (file)
@@ -594,7 +594,6 @@ bool cluster_id_equal(const struct server_id *id1,
                      const struct server_id *id2);
 bool procid_is_me(const struct server_id *pid);
 struct server_id interpret_pid(const char *pid_string);
-char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid);
 char *procid_str_static(const struct server_id *pid);
 bool procid_valid(const struct server_id *pid);
 bool procid_is_local(const struct server_id *pid);
index c3d863f9a44fb2e6f4309cb1f05bab5aa3b33c69..7089d0f1d2b16f99efdd158ff3fab8a54efdf5c4 100644 (file)
@@ -108,7 +108,7 @@ static bool g_lock_parse(TALLOC_CTX *mem_ctx, TDB_DATA data,
        DEBUG(10, ("locks:\n"));
        for (i=0; i<num_locks; i++) {
                DEBUGADD(10, ("%s: %s %s\n",
-                             procid_str(talloc_tos(), &locks[i].pid),
+                             server_id_str(talloc_tos(), &locks[i].pid),
                              ((locks[i].lock_type & 1) == G_LOCK_READ) ?
                              "read" : "write",
                              (locks[i].lock_type & G_LOCK_PENDING) ?
@@ -118,7 +118,7 @@ static bool g_lock_parse(TALLOC_CTX *mem_ctx, TDB_DATA data,
                    && !process_exists(locks[i].pid)) {
 
                        DEBUGADD(10, ("lock owner %s died -- discarding\n",
-                                     procid_str(talloc_tos(),
+                                     server_id_str(talloc_tos(),
                                                 &locks[i].pid)));
 
                        if (i < (num_locks-1)) {
@@ -146,7 +146,7 @@ static void g_lock_cleanup(int *pnum_locks, struct g_lock_rec *locks)
                        continue;
                }
                DEBUGADD(10, ("%s does not exist -- discarding\n",
-                             procid_str(talloc_tos(), &locks[i].pid)));
+                             server_id_str(talloc_tos(), &locks[i].pid)));
 
                if (i < (num_locks-1)) {
                        locks[i] = locks[num_locks-1];
@@ -496,7 +496,7 @@ static void g_lock_got_retry(struct messaging_context *msg,
        bool *pretry = (bool *)private_data;
 
        DEBUG(10, ("Got retry message from pid %s\n",
-                  procid_str(talloc_tos(), &server_id)));
+                  server_id_str(talloc_tos(), &server_id)));
 
        *pretry = true;
 }
@@ -587,7 +587,7 @@ static NTSTATUS g_lock_force_unlock(struct g_lock_ctx *ctx, const char *name,
                                                &data_blob_null);
                        if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(1, ("sending retry to %s failed: %s\n",
-                                         procid_str(talloc_tos(),
+                                         server_id_str(talloc_tos(),
                                                     &locks[i].pid),
                                          nt_errstr(status)));
                        } else {
index 4d45c0e3c2dba6b5758624bcad275ff9a3faea35..b0f84a718a47d9059f6e9b06c89901cf3138bbdc 100644 (file)
@@ -1986,25 +1986,9 @@ struct server_id interpret_pid(const char *pid_string)
        return result;
 }
 
-char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid)
-{
-       if (pid->vnn == NONCLUSTER_VNN && pid->task_id == 0) {
-               return talloc_asprintf(mem_ctx,
-                               "%llu",
-                               (unsigned long long)pid->pid);
-       }
-       else {
-               return talloc_asprintf(mem_ctx,
-                                      "%u:%llu:%u",
-                                      (unsigned)pid->vnn,
-                                      (unsigned long long)pid->pid,
-                                      (unsigned)pid->task_id);
-       }
-}
-
 char *procid_str_static(const struct server_id *pid)
 {
-       return procid_str(talloc_tos(), pid);
+       return server_id_str(talloc_tos(), pid);
 }
 
 bool procid_valid(const struct server_id *pid)
index 220688c7e746a0349511391b11b94eeefeda5ea6..b5031bd7c3739ec653a06d3a07c6e67b92b8a146 100644 (file)
@@ -51,7 +51,7 @@ static void print_lock_struct(unsigned int i, struct lock_struct *pls)
                        i,
                        (unsigned long long)pls->context.smblctx,
                        (unsigned int)pls->context.tid,
-                       procid_str(talloc_tos(), &pls->context.pid) ));
+                       server_id_str(talloc_tos(), &pls->context.pid) ));
 
        DEBUG(10,("start = %.0f, size = %.0f, fnum = %d, %s %s\n",
                (double)pls->start,
index 02eb3361b87965547b33381226527e4205634266..3add58d9b1a7796f0c53a162c3f38c6fb27ca7f6 100644 (file)
@@ -459,7 +459,7 @@ void process_oplock_async_level2_break_message(struct messaging_context *msg_ctx
        message_to_share_mode_entry(&msg, (char *)data->data);
 
        DEBUG(10, ("Got oplock async level 2 break message from pid %s: "
-                  "%s/%lu\n", procid_str(talloc_tos(), &src),
+                  "%s/%lu\n", server_id_str(talloc_tos(), &src),
                   file_id_string_tos(&msg.id), msg.share_file_id));
 
        fsp = initial_break_processing(sconn, msg.id, msg.share_file_id);
@@ -510,7 +510,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
        message_to_share_mode_entry(&msg, (char *)data->data);
 
        DEBUG(10, ("Got oplock break message from pid %s: %s/%lu\n",
-                  procid_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
+                  server_id_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
                   msg.share_file_id));
 
        fsp = initial_break_processing(sconn, msg.id, msg.share_file_id);
@@ -617,7 +617,7 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx,
        file_id = (unsigned long)IVAL(data->data, 24);
 
        DEBUG(10, ("Got kernel oplock break message from pid %s: %s/%u\n",
-                  procid_str(talloc_tos(), &src), file_id_string_tos(&id),
+                  server_id_str(talloc_tos(), &src), file_id_string_tos(&id),
                   (unsigned int)file_id));
 
        fsp = initial_break_processing(sconn, id, file_id);
@@ -704,7 +704,7 @@ static void process_oplock_break_response(struct messaging_context *msg_ctx,
        message_to_share_mode_entry(&msg, (char *)data->data);
 
        DEBUG(10, ("Got oplock break response from pid %s: %s/%lu mid %llu\n",
-                  procid_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
+                  server_id_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
                   msg.share_file_id, (unsigned long long)msg.op_mid));
 
        schedule_deferred_open_message_smb(msg.op_mid);
@@ -732,7 +732,7 @@ static void process_open_retry_message(struct messaging_context *msg_ctx,
        message_to_share_mode_entry(&msg, (char *)data->data);
 
        DEBUG(10, ("Got open retry msg from pid %s: %s mid %llu\n",
-                  procid_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
+                  server_id_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
                   (unsigned long long)msg.op_mid));
 
        schedule_deferred_open_message_smb(msg.op_mid);
index ee305c478e547a2aa073edbcdd48d2d1d41a91d2..98bed880df83a6ab47c6a46538948d3bb3428052 100644 (file)
@@ -1223,7 +1223,7 @@ static int shutdown_other_smbds(const struct connections_key *key,
        struct shutdown_state *state = (struct shutdown_state *)private_data;
 
        DEBUG(10, ("shutdown_other_smbds: %s, %s\n",
-                  procid_str(talloc_tos(), &crec->pid), crec->addr));
+                  server_id_str(talloc_tos(), &crec->pid), crec->addr));
 
        if (!process_exists(crec->pid)) {
                DEBUG(10, ("process does not exist\n"));
index 6ed5d1776a63992858acdb73102f0e9b6b0041ac..bfb9a225abd4889eb1c43c5a9b7964f91c98e96b 100644 (file)
@@ -113,7 +113,7 @@ static int net_g_lock_dump_fn(struct server_id pid, enum g_lock_type lock_type,
 {
        char *pidstr;
 
-       pidstr = procid_str(talloc_tos(), &pid);
+       pidstr = server_id_str(talloc_tos(), &pid);
        d_printf("%s: %s (%s)\n", pidstr,
                 (lock_type & 1) ? "WRITE" : "READ",
                 (lock_type & G_LOCK_PENDING) ? "pending" : "holder");
index 08a1a7f298bc04ad0bc016b3a6ea0828f957987f..2c3320f40e1c51a6b95105482c1911f80a1cfc40 100644 (file)
@@ -26,7 +26,7 @@
 static int net_serverid_list_fn(const struct server_id *id,
                                uint32_t msg_flags, void *priv)
 {
-       char *str = procid_str(talloc_tos(), id);
+       char *str = server_id_str(talloc_tos(), id);
        d_printf("%s %llu 0x%x\n", str, (unsigned long long)id->unique_id,
                 (unsigned int)msg_flags);
        TALLOC_FREE(str);
@@ -51,7 +51,7 @@ static int net_serverid_wipe_fn(struct db_record *rec,
        }
        status = rec->delete_rec(rec);
        if (!NT_STATUS_IS_OK(status)) {
-               char *str = procid_str(talloc_tos(), id);
+               char *str = server_id_str(talloc_tos(), id);
                DEBUG(1, ("Could not delete serverid.tdb record %s: %s\n",
                          str, nt_errstr(status)));
                TALLOC_FREE(str);
@@ -75,13 +75,13 @@ static int net_serverid_wipedbs_conn(
                NTSTATUS status;
 
                DEBUG(10, ("Deleting connections.tdb record for pid %s\n",
-                          procid_str(talloc_tos(), &key->pid)));
+                          server_id_str(talloc_tos(), &key->pid)));
 
                status = rec->delete_rec(rec);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("Could not delete connections.tdb record "
                                  "for pid %s: %s\n",
-                                 procid_str(talloc_tos(), &key->pid),
+                                 server_id_str(talloc_tos(), &key->pid),
                                  nt_errstr(status)));
                }
        }
@@ -97,13 +97,13 @@ static int net_serverid_wipedbs_sessionid(struct db_record *rec,
                NTSTATUS status;
 
                DEBUG(10, ("Deleting sessionid.tdb record for pid %s\n",
-                          procid_str(talloc_tos(), &session->pid)));
+                          server_id_str(talloc_tos(), &session->pid)));
 
                status = rec->delete_rec(rec);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("Could not delete session.tdb record "
                                  "for pid %s: %s\n",
-                                 procid_str(talloc_tos(), &session->pid),
+                                 server_id_str(talloc_tos(), &session->pid),
                                  nt_errstr(status)));
                }
        }
index 5bf5c5da7b48806d1af0a2693949b410d4da0ebe..0a3a94a1df0489dcddb7a3f2a226e136e0e66742 100644 (file)
@@ -119,7 +119,7 @@ static void print_pid_string_cb(struct messaging_context *msg,
 {
        char *pidstr;
 
-       pidstr = procid_str(talloc_tos(), &pid);
+       pidstr = server_id_str(talloc_tos(), &pid);
        printf("PID %s: %.*s", pidstr, (int)data->length,
               (const char *)data->data);
        TALLOC_FREE(pidstr);
@@ -433,7 +433,7 @@ static void pong_cb(struct messaging_context *msg,
                    struct server_id pid,
                    DATA_BLOB *data)
 {
-       char *src_string = procid_str(NULL, &pid);
+       char *src_string = server_id_str(NULL, &pid);
        printf("PONG from pid %s\n", src_string);
        TALLOC_FREE(src_string);
        num_replies++;
@@ -1143,7 +1143,7 @@ static void winbind_validate_cache_cb(struct messaging_context *msg,
                                      struct server_id pid,
                                      DATA_BLOB *data)
 {
-       char *src_string = procid_str(NULL, &pid);
+       char *src_string = server_id_str(NULL, &pid);
        printf("Winbindd cache is %svalid. (answer from pid %s)\n",
               (*(data->data) == 0 ? "" : "NOT "), src_string);
        TALLOC_FREE(src_string);
index 767e6a719f0dcedc3b884bb9aeeed11c3e58e0a6..757489ebce6da60718a92159054a80fccf731486 100644 (file)
@@ -56,17 +56,6 @@ struct server_id cluster_id(uint64_t pid, uint32_t task_id)
        return ops->cluster_id(ops, pid, task_id);
 }
 
-
-/*
-  return a server_id as a string
-*/
-char *cluster_id_string(TALLOC_CTX *mem_ctx, struct server_id id)
-{
-       cluster_init();
-       return ops->cluster_id_string(ops, mem_ctx, id);
-}
-
-
 /*
   open a temporary tdb in a cluster friendly manner
 */
index a6f74f956c935b51f83e57327c6c1f407eeb853c..3dd9f4ce7c52409d1c19db905fd06517fd522ac7 100644 (file)
@@ -41,7 +41,6 @@ typedef void (*cluster_message_fn_t)(struct imessaging_context *, DATA_BLOB);
 
 /* prototypes */
 struct server_id cluster_id(uint64_t id, uint32_t task_id);
-char *cluster_id_string(TALLOC_CTX *mem_ctx, struct server_id id);
 struct tdb_wrap *cluster_tdb_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *dbname, int flags);
 void *cluster_backend_handle(void);
 
index 5f038dd92fc833d1a41259c1c44ed5f816d07cb3..6f68ad62bd7680c0a9d9d147a960c54bd6a79074 100644 (file)
@@ -24,8 +24,6 @@
 
 struct cluster_ops {
        struct server_id (*cluster_id)(struct cluster_ops *ops, uint64_t id, uint32_t id2);
-       char *(*cluster_id_string)(struct cluster_ops *ops,
-                                  TALLOC_CTX *, struct server_id );
        struct tdb_wrap *(*cluster_tdb_tmp_open)(struct cluster_ops *,
                                                 TALLOC_CTX *, 
                                                 struct loadparm_context *,
index e7b648fc9bea5658f877a5d595763b7106d75527..833a86b07fba7e9d942b0123e0258c594a4e1f2d 100644 (file)
@@ -41,16 +41,6 @@ static struct server_id local_id(struct cluster_ops *ops, uint64_t pid, uint32_t
 }
 
 
-/*
-  return a server_id as a string
-*/
-static char *local_id_string(struct cluster_ops *ops,
-                                  TALLOC_CTX *mem_ctx, struct server_id id)
-{
-       return talloc_asprintf(mem_ctx, "%u.%llu.%u", id.vnn, (unsigned long long)id.pid, id.task_id);
-}
-
-
 /*
   open a tmp tdb for the local node. By using smbd_tmp_path() we don't need
   TDB_CLEAR_IF_FIRST as the tmp path is wiped at startup
@@ -98,7 +88,6 @@ static NTSTATUS local_message_send(struct cluster_ops *ops,
 
 static struct cluster_ops cluster_local_ops = {
        .cluster_id           = local_id,
-       .cluster_id_string    = local_id_string,
        .cluster_tdb_tmp_open = local_tdb_tmp_open,
        .backend_handle       = local_backend_handle,
        .message_init         = local_message_init,
index 3a330d5794f31feec838a229faef7fb13c9e4fe1..aa1b43308f47237825be9981641f8d48a09915f8 100644 (file)
@@ -109,7 +109,7 @@ static void irpc_handler(struct imessaging_context *, void *,
 static void ping_message(struct imessaging_context *msg, void *private_data,
                         uint32_t msg_type, struct server_id src, DATA_BLOB *data)
 {
-       char *task_id = cluster_id_string(NULL, src);
+       char *task_id = server_id_str(NULL, &src);
        DEBUG(1,("INFO: Received PING message from server %s [%.*s]\n",
                 task_id, (int)data->length,
                 data->data?(const char *)data->data:""));
@@ -134,7 +134,7 @@ static NTSTATUS irpc_uptime(struct irpc_message *msg,
 static char *imessaging_path(struct imessaging_context *msg, struct server_id server_id)
 {
        TALLOC_CTX *tmp_ctx = talloc_new(msg);
-       const char *id = cluster_id_string(tmp_ctx, server_id);
+       const char *id = server_id_str(tmp_ctx, &server_id);
        char *s;
        if (id == NULL) {
                return NULL;
@@ -284,8 +284,8 @@ static void imessaging_send_handler(struct imessaging_context *msg)
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_CTX *tmp_ctx = talloc_new(msg);
                        DEBUG(1,("messaging: Lost message from %s to %s of type %u - %s\n", 
-                                cluster_id_string(tmp_ctx, rec->header->from),
-                                cluster_id_string(tmp_ctx, rec->header->to),
+                                server_id_str(tmp_ctx, &rec->header->from),
+                                server_id_str(tmp_ctx, &rec->header->to),
                                 rec->header->msg_type, 
                                 nt_errstr(status)));
                        talloc_free(tmp_ctx);
index 1e5d5681f46ed1b6e6119497f43f9be1a61b6695..1379fe31cf522b997913e95498ccf5a8272158e6 100644 (file)
@@ -502,7 +502,7 @@ static void switch_message(int type, struct smbsrv_request *req)
                }
        }
 
-       task_id = cluster_id_string(NULL, req->smb_conn->connection->server_id);
+       task_id = server_id_str(NULL, &req->smb_conn->connection->server_id);
        DEBUG(5,("switch message %s (task_id %s)\n",
                 smb_fn_name(type), task_id));
        talloc_free(task_id);
index efbcfb490a2c40d2186568a24ba4f65cb6dd8858..6e65122063b253cd275eb3576955801b409237c6 100644 (file)
@@ -217,7 +217,7 @@ static void stream_new_connection(struct tevent_context *ev,
                                        stream_socket->ops->name, 
                                        tsocket_address_string(srv_conn->remote_address, tmp_ctx),
                                        tsocket_address_string(srv_conn->local_address, tmp_ctx),
-                                       cluster_id_string(tmp_ctx, server_id));
+                                       server_id_str(tmp_ctx, &server_id));
                if (title) {
                        stream_connection_set_title(srv_conn, title);
                }