summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Smokeping')
-rw-r--r--lib/Smokeping/Master.pm2
-rw-r--r--lib/Smokeping/Slave.pm10
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/Smokeping/Master.pm b/lib/Smokeping/Master.pm
index 9e69b28..f8704a0 100644
--- a/lib/Smokeping/Master.pm
+++ b/lib/Smokeping/Master.pm
@@ -269,7 +269,7 @@ sub answer_slave {
return;
}
} else {
- print "Content-Type: text/plain\nProtocol: $PROTOCOL\n\nOK\n";
+ print "Content-Type: text/plain\n\nOK\n";
};
return;
}
diff --git a/lib/Smokeping/Slave.pm b/lib/Smokeping/Slave.pm
index 7cc3b7e..0931c80 100644
--- a/lib/Smokeping/Slave.pm
+++ b/lib/Smokeping/Slave.pm
@@ -93,16 +93,16 @@ sub submit_results {
my $key = $response->header('Key');
my $protocol = $response->header('Protocol') || '?';
- if ($protocol ne $PROTOCOL){
- warn "WARNING $slave_cfg->{master_url} sent data with protocol $protocol. Expected $PROTOCOL.";
- return undef;
- }
-
if ($response->header('Content-Type') ne 'application/smokeping-config'){
warn "$data\n" unless $data =~ /OK/;
Smokeping::do_debuglog("Sent data to Server. Server said $data");
return undef;
};
+
+ if ($protocol ne $PROTOCOL){
+ warn "WARNING $slave_cfg->{master_url} sent data with protocol $protocol. Expected $PROTOCOL.";
+ return undef;
+ }
if (hmac_md5_hex($data,$slave_cfg->{shared_secret}) ne $key){
warn "WARNING $slave_cfg->{master_url} sent data with wrong key";
return undef;