#include "log.h"
#include "conf.h"
+#include "util.h"
#define STRSIZE 254
offset += vsnprintf(&buf[offset], STRSIZE - offset, logstring, argp);
va_end(argp);
+ char *clientAddressString = Util_clientAddressToString(client);
offset += snprintf(&buf[offset], STRSIZE - offset, " - [%d] %s@%s:%d",
- client->sessionId,
- client->username == NULL ? "" : client->username,
- inet_ntoa(client->remote_tcp.sin_addr),
- ntohs(client->remote_tcp.sin_port));
+ client->sessionId,
+ client->username == NULL ? "" : client->username,
+ clientAddressString,
+ Util_clientAddressToPortTCP(client));
+ free(clientAddressString);
+
if (termprint)
fprintf(stderr, "%s\n", buf);
else if (logfile)