Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
sbws
Commits
66ee7406
Commit
66ee7406
authored
Jan 08, 2019
by
juga
Browse files
scanner: create global variables launching threads
so that the objects that manage the threads can be stop at any time.
parent
27fb6cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/core/scanner.py
View file @
66ee7406
...
...
@@ -24,6 +24,11 @@ from .. import settings
rng
=
random
.
SystemRandom
()
log
=
logging
.
getLogger
(
__name__
)
# Declare the objects that manage the threads global so that sbws can exit
# gracefully at any time.
pool
=
None
rd
=
None
controller
=
None
def
timed_recv_from_server
(
session
,
dest
,
byte_range
):
...
...
@@ -329,6 +334,7 @@ def result_putter_error(target):
def
run_speedtest
(
args
,
conf
):
global
rd
,
pool
,
controller
controller
,
_
=
stem_utils
.
init_controller
(
path
=
conf
.
getpath
(
'tor'
,
'control_socket'
))
if
not
controller
:
...
...
Write
Preview
Supports
Markdown
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