diff src/doveadm/dsync/dsync-brain.c @ 17279:fac4e7320676

dsync: If dsync was started via doveadm-server, show the remote client's IP address in ps output.
author Timo Sirainen <tss@iki.fi>
date Mon, 28 Apr 2014 18:24:04 +0300
parents bb5deb884303
children 9669c9a8984f
line wrap: on
line diff
--- a/src/doveadm/dsync/dsync-brain.c	Sun Apr 27 19:05:38 2014 +0300
+++ b/src/doveadm/dsync/dsync-brain.c	Mon Apr 28 18:24:04 2014 +0300
@@ -41,6 +41,8 @@
 	const char *import_title, *export_title;
 
 	str_append_c(str, '[');
+	if (brain->process_title_prefix != NULL)
+		str_append(str, brain->process_title_prefix);
 	str_append(str, brain->user->username);
 	if (brain->box == NULL) {
 		str_append_c(str, ' ');
@@ -155,6 +157,8 @@
 	i_assert(N_ELEMENTS(dsync_state_names) == DSYNC_STATE_DONE+1);
 
 	brain = dsync_brain_common_init(user, ibc);
+	brain->process_title_prefix =
+		p_strdup(brain->pool, set->process_title_prefix);
 	brain->sync_type = sync_type;
 	if (array_count(&set->sync_namespaces) > 0) {
 		sync_ns_str = t_str_new(128);
@@ -219,12 +223,14 @@
 
 struct dsync_brain *
 dsync_brain_slave_init(struct mail_user *user, struct dsync_ibc *ibc,
-		       bool local)
+		       bool local, const char *process_title_prefix)
 {
 	struct dsync_ibc_settings ibc_set;
 	struct dsync_brain *brain;
 
 	brain = dsync_brain_common_init(user, ibc);
+	brain->process_title_prefix =
+		p_strdup(brain->pool, process_title_prefix);
 	brain->state = DSYNC_STATE_SLAVE_RECV_HANDSHAKE;
 
 	if (local) {