When connecting to a monitor, if it fails, disconnect. This should fix a bug in zmtrigger and others where it would never reconnect. The idea is that we asked for a successful connection, if it failed, we shouldn't be in a failed connected state, we should be disconnected.
This commit is contained in:
parent
8fe0cb5e33
commit
a748b0ed0a
|
@ -298,11 +298,16 @@ sub Event_Summary {
|
||||||
|
|
||||||
sub connect {
|
sub connect {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return ZoneMinder::Memory::zmMemVerify($self);
|
ZoneMinder::Logger::Debug(4, "Connecting");
|
||||||
|
if (!ZoneMinder::Memory::zmMemVerify($self)) {
|
||||||
|
$self->disconnect();
|
||||||
|
}
|
||||||
|
return !undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub disconnect {
|
sub disconnect {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
ZoneMinder::Logger::Debug(4, "Disconnecting");
|
||||||
ZoneMinder::Memory::zmMemInvalidate($self); # Close our file handle to the zmc process we are about to end
|
ZoneMinder::Memory::zmMemInvalidate($self); # Close our file handle to the zmc process we are about to end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue