Skip to content
This repository
Browse code

Don't include the server_id in the json version data

  • Loading branch information...
commit f75985d80339cd33c0a0f1df8a402fed533264b7 1 parent cb12ec7
Ask Bjørn Hansen authored

Showing 1 changed file with 14 additions and 4 deletions. Show diff stats Hide diff stats

  1. +14 4 lib/GeoDNS.pm
18 lib/GeoDNS.pm
@@ -34,9 +34,14 @@ sub new {
34 34 return bless \%args, $class;
35 35 }
36 36
  37 +sub version {
  38 + my $self = shift;
  39 + return "v$VERSION" . ($git ? "/$git" : "");
  40 +}
  41 +
37 42 sub version_full {
38 43 my $self = shift;
39   - return "$self->{server_id}, v$VERSION" . ($git ? "/$git" : "");
  44 + return "$self->{server_id}, ". $self->version;
40 45 }
41 46
42 47 sub config {
@@ -184,7 +189,7 @@ sub reply_handler {
184 189 up => ((time - $stats->{started}) || 1),
185 190 id => $self->{server_id},
186 191 qs => $stats->{queries},
187   - v => $self->version_full,
  192 + v => $self->version,
188 193 };
189 194 my $status = $json_dns->encode($data);
190 195 push @ans, Net::DNS::RR->new("$domain. 1 $query_class TXT '$status'") if $query_type eq 'TXT' or $query_type eq 'ANY';
@@ -630,10 +635,15 @@ Called automatically from the reply_handler.
630 635
631 636 Given a domain name, returns the longest matching configured "base".
632 637
  638 +=item version
  639 +
  640 +Returns a string with the current version number and git commit (if
  641 +run from a git checkout).
  642 +
633 643 =item version_full
634 644
635   -Returns a string with the server id (interface), version number and
636   -git commit (if run from a git checkout).
  645 +Returns a string with the version (see above) prepended with the
  646 +server id (interface)
637 647
638 648 =back
639 649

0 comments on commit f75985d

Please sign in to comment.
Something went wrong with that request. Please try again.