Skip to content

Commit

Permalink
check GUI and daemon versions granularly
Browse files Browse the repository at this point in the history
Do not display the warning dialog about diferent versions
(daemon<->GUI), if we only have relesed fixes or minor changes.
  • Loading branch information
gustavo-iniguez-goya committed Jul 28, 2020
1 parent dba0c83 commit d137a50
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ui/opensnitch/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ def _async_worker(self):
self._status_change_trigger.emit()
was_connected = self._connected

def _check_versions(self, daemon_version):
lMayor, lMinor, lPatch = version.split(".")
rMayor, rMinor, rPatch = daemon_version.split(".")
if lMayor != rMayor or (lMayor == rMayor and lMinor != rMinor):
self._version_warning_trigger.emit(daemon_version, version)

def _is_local_request(self, proto, addr):
if proto == "unix":
return True
Expand Down Expand Up @@ -372,8 +378,7 @@ def _populate_stats_events(self, db, addr, stats, table, colnames, cols, items):
def Ping(self, request, context):
try:
self._last_ping = datetime.now()
if request.stats.daemon_version != version:
self._version_warning_trigger.emit(request.stats.daemon_version, version)
self._check_versions(request.stats.daemon_version)

proto, addr = self._get_peer(context.peer())
# do not update db here, do it on the main thread
Expand Down

0 comments on commit d137a50

Please sign in to comment.