}
if (unix_socket && str_len(label) > 0)
str_insert(label, 0, "unix:");
+ if (conn->list->set.log_connection_id) {
+ if (str_len(label) > 0)
+ str_append_c(label, ' ');
+ str_printfa(label, "[%u]", conn->id);
+ }
i_free(conn->label);
conn->label = i_strdup(str_c(label));
connection_init_full(struct connection_list *list, struct connection *conn,
const char *name, int fd_in, int fd_out)
{
+ if (conn->id == 0) {
+ if (list->id_counter == 0)
+ list->id_counter++;
+ conn->id = list->id_counter++;
+ }
+
conn->ioloop = current_ioloop;
conn->fd_in = fd_in;
conn->fd_out = fd_out;
to make the functionality identical with inet sockets, which may
simplify the calling code. */
bool delayed_unix_client_connected_callback;
+ /* Put the connection id in the log prefix */
+ bool log_connection_id;
/* If connect() to UNIX socket fails with EAGAIN, retry for this many
milliseconds before giving up (0 = try once) */
unsigned int unix_client_connect_msecs;
char *name;
char *label;
char *property_label;
+ unsigned int id;
int fd_in, fd_out;
struct ioloop *ioloop;
struct connection *connections;
unsigned int connections_count;
+ unsigned int id_counter;
+
struct connection_settings set;
struct connection_vfuncs v;
};