int port;
int fd;
+ char *name;
+
int state;
int skip_newline;
int is_sock;
free(client->hostname);
if (client->argv)
free(client->argv);
+ if (client->name)
+ free(client->name);
free(client);
nr_clients--;
display_thread_status(je);
}
-static void handle_probe(struct fio_net_cmd *cmd)
+static void handle_probe(struct fio_client *client, struct fio_net_cmd *cmd)
{
struct cmd_probe_pdu *probe = (struct cmd_probe_pdu *) cmd->payload;
const char *os, *arch;
log_info("hostname=%s, be=%u, os=%s, arch=%s, fio=%u.%u.%u\n",
probe->hostname, probe->bigendian, os, arch, probe->fio_major,
probe->fio_minor, probe->fio_patch);
+
+ if (!client->name)
+ client->name = strdup((char *) probe->hostname);
}
static int handle_client(struct fio_client *client)
break;
case FIO_NET_CMD_TEXT: {
const char *buf = (const char *) cmd->payload;
+ const char *name;
int fio_unused ret;
+ name = client->name ? client->name : client->hostname;
+
if (!client->skip_newline)
- fprintf(f_out, "<%s> ", client->hostname);
+ fprintf(f_out, "<%s> ", name);
ret = fwrite(buf, cmd->pdu_len, 1, f_out);
fflush(f_out);
client->skip_newline = strchr(buf, '\n') == NULL;
free(cmd);
break;
case FIO_NET_CMD_PROBE:
- handle_probe(cmd);
+ handle_probe(client, cmd);
free(cmd);
break;
case FIO_NET_CMD_START: