summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-11-15 17:45:01 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-11-15 17:45:01 +0100
commit5b6343f51a0913400c15392389668a019727a9a1 (patch)
treef611c044f47497d7cdc62617e9aa2b8005ebcd27 /src
parent89bf354b9175794972733c0940adceb225a88728 (diff)
downloadfastd-5b6343f51a0913400c15392389668a019727a9a1.tar
fastd-5b6343f51a0913400c15392389668a019727a9a1.zip
Revert "Use peer specifier from log instead of the peer name for the status output"
This reverts commit be929dbe2dffa82ca1f91538f56a1bb0490000bd.
Diffstat (limited to 'src')
-rw-r--r--src/log.c4
-rw-r--r--src/log.h1
-rw-r--r--src/status.c5
3 files changed, 3 insertions, 7 deletions
diff --git a/src/log.c b/src/log.c
index 8e2fa56..1559496 100644
--- a/src/log.c
+++ b/src/log.c
@@ -92,7 +92,7 @@ size_t fastd_snprint_peer_address(char *buffer, size_t size, const fastd_peer_ad
}
/** Creates a string representation of a peer */
-size_t fastd_snprint_peer_str(char *buffer, size_t size, const fastd_peer_t *peer) {
+static size_t snprint_peer_str(char *buffer, size_t size, const fastd_peer_t *peer) {
if (peer) {
if (peer->name) {
return snprintf_safe(buffer, size, "<%s>", peer->name);
@@ -168,7 +168,7 @@ static int fastd_vsnprintf(char *buffer, size_t size, const char *format, va_lis
break;
case 'P':
- buffer += fastd_snprint_peer_str(buffer, buffer_end-buffer, va_arg(ap, const fastd_peer_t *));
+ buffer += snprint_peer_str(buffer, buffer_end-buffer, va_arg(ap, const fastd_peer_t *));
break;
case 'I':
diff --git a/src/log.h b/src/log.h
index 31d1c8c..5fce09f 100644
--- a/src/log.h
+++ b/src/log.h
@@ -54,7 +54,6 @@ typedef enum fastd_loglevel {
size_t fastd_snprint_peer_address(char *buffer, size_t size, const fastd_peer_address_t *address, const char *iface, bool bind_address, bool hide);
-size_t fastd_snprint_peer_str(char *buffer, size_t size, const fastd_peer_t *peer);
void fastd_logf(const fastd_loglevel_t level, const char *format, ...);
diff --git a/src/status.c b/src/status.c
index 36a38b6..8e0c427 100644
--- a/src/status.c
+++ b/src/status.c
@@ -174,10 +174,7 @@ static void dump_status(int fd) {
if (!fastd_peer_is_enabled(peer))
continue;
- char name[1024];
- fastd_snprint_peer_str(name, sizeof(name), peer);
-
- json_object_object_add(peers, name, dump_peer(peer));
+ json_object_object_add(peers, peer->name, dump_peer(peer));
}