Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
re6stnet
Commits
ee2db2f4
Commit
ee2db2f4
authored
Jan 30, 2025
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix possible crash when asking the registry to geo-locate an ip
This fixes a regression in commit
6ac47ffb
.
parent
5e2a7145
Pipeline
#39417
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
re6st/cache.py
re6st/cache.py
+6
-4
No files found.
re6st/cache.py
View file @
ee2db2f4
...
...
@@ -269,8 +269,10 @@ class Cache:
q
(
"INSERT OR REPLACE INTO peer VALUES (?,?)"
,
(
prefix
,
address
))
q
(
"INSERT OR REPLACE INTO volatile.stat VALUES (?,0)"
,
(
prefix
,))
def
getCountry
(
self
,
ip
:
str
)
->
str
:
def
getCountry
(
self
,
ip
:
str
)
->
str
|
None
:
try
:
return
self
.
_registry
.
getCountry
(
self
.
_prefix
,
ip
).
decode
()
except
socket
.
error
as
e
:
logging
.
warning
(
'Failed to get country (%s)'
,
ip
)
country
=
self
.
_registry
.
getCountry
(
self
.
_prefix
,
ip
)
if
country
is
not
None
:
return
country
.
decode
()
except
(
socket
.
error
,
UnicodeDecodeError
)
as
e
:
logging
.
warning
(
'Failed to get country for %s (%s)'
,
ip
,
e
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment