Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openwebrx-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ha7ilm
openwebrx-mirror
Commits
5d38c210
Commit
5d38c210
authored
Dec 1, 2014
by
ha7ilm
Browse files
Options
Downloads
Patches
Plain Diff
fix client_mutex lockup
parent
8572479e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
openwebrx.py
+26
-15
26 additions, 15 deletions
openwebrx.py
plugins/dsp/csdr/plugin.py
+1
-1
1 addition, 1 deletion
plugins/dsp/csdr/plugin.py
with
27 additions
and
16 deletions
openwebrx.py
+
26
−
15
View file @
5d38c210
...
@@ -224,6 +224,7 @@ class WebRXHandler(BaseHTTPRequestHandler):
...
@@ -224,6 +224,7 @@ class WebRXHandler(BaseHTTPRequestHandler):
def
do_GET
(
self
):
def
do_GET
(
self
):
global
dsp_plugin
global
dsp_plugin
global
clients_mutex
rootdir
=
'
htdocs
'
rootdir
=
'
htdocs
'
self
.
path
=
self
.
path
.
replace
(
"
..
"
,
""
)
self
.
path
=
self
.
path
.
replace
(
"
..
"
,
""
)
path_temp_parts
=
self
.
path
.
split
(
"
?
"
)
path_temp_parts
=
self
.
path
.
split
(
"
?
"
)
...
@@ -236,16 +237,17 @@ class WebRXHandler(BaseHTTPRequestHandler):
...
@@ -236,16 +237,17 @@ class WebRXHandler(BaseHTTPRequestHandler):
if
self
.
path
[:
4
]
==
"
/ws/
"
:
if
self
.
path
[:
4
]
==
"
/ws/
"
:
try
:
try
:
# ========= WebSocket handshake =========
# ========= WebSocket handshake =========
ws_success
=
True
try
:
try
:
rxws
.
handshake
(
self
)
rxws
.
handshake
(
self
)
clients_mutex
.
acquire
()
clients_mutex
.
acquire
()
client_i
=
get_client_by_id
(
self
.
path
[
4
:],
False
)
client_i
=
get_client_by_id
(
self
.
path
[
4
:],
False
)
myclient
=
clients
[
client_i
]
myclient
=
clients
[
client_i
]
clients_mutex
.
release
()
except
rxws
.
WebSocketException
:
ws_success
=
False
except
rxws
.
WebSocketException
:
except
ClientNotFoundException
:
ws_success
=
False
self
.
send_error
(
400
,
'
Bad request.
'
)
finally
:
return
if
clients_mutex
.
locked
():
clients_mutex
.
release
()
except
ClientNotFoundException
:
if
not
ws_success
:
self
.
send_error
(
400
,
'
Bad request.
'
)
self
.
send_error
(
400
,
'
Bad request.
'
)
return
return
...
@@ -310,24 +312,32 @@ class WebRXHandler(BaseHTTPRequestHandler):
...
@@ -310,24 +312,32 @@ class WebRXHandler(BaseHTTPRequestHandler):
dsp
.
set_bpf
(
*
new_bpf
)
dsp
.
set_bpf
(
*
new_bpf
)
#code.interact(local=locals())
#code.interact(local=locals())
except
:
except
:
print
"
[openwebrx-httpd] exception happened at all
"
exc_type
,
exc_value
,
exc_traceback
=
sys
.
exc_info
()
exc_type
,
exc_value
,
exc_traceback
=
sys
.
exc_info
()
if
exc_value
[
0
]
==
32
:
#"broken pipe", client disconnected
if
exc_value
[
0
]
==
32
:
#"broken pipe", client disconnected
pass
pass
elif
exc_value
[
0
]
==
11
:
#"resource unavailable" on recv, client disconnected
elif
exc_value
[
0
]
==
11
:
#"resource unavailable" on recv, client disconnected
pass
pass
else
:
else
:
print
"
[openwebrx-httpd] error:
"
,
exc_type
,
exc_value
print
"
[openwebrx-httpd] error
in /ws/ handler
:
"
,
exc_type
,
exc_value
traceback
.
print_tb
(
exc_traceback
)
traceback
.
print_tb
(
exc_traceback
)
#delete disconnected client
#stop dsp for the disconnected client
try
:
try
:
dsp
.
stop
()
dsp
.
stop
()
del
dsp
del
dsp
except
:
except
:
pass
print
"
[openwebrx-httpd] error in dsp.stop()
"
#delete disconnected client
try
:
clients_mutex
.
acquire
()
clients_mutex
.
acquire
()
id_to_close
=
get_client_by_id
(
myclient
.
id
,
False
)
id_to_close
=
get_client_by_id
(
myclient
.
id
,
False
)
close_client
(
id_to_close
,
False
)
close_client
(
id_to_close
,
False
)
except
:
exc_type
,
exc_value
,
exc_traceback
=
sys
.
exc_info
()
print
"
[openwebrx-httpd] client cannot be closed:
"
,
exc_type
,
exc_value
traceback
.
print_tb
(
exc_traceback
)
finally
:
clients_mutex
.
release
()
clients_mutex
.
release
()
return
return
else
:
else
:
...
@@ -375,9 +385,10 @@ class WebRXHandler(BaseHTTPRequestHandler):
...
@@ -375,9 +385,10 @@ class WebRXHandler(BaseHTTPRequestHandler):
self
.
send_error
(
404
,
'
Invalid path.
'
)
self
.
send_error
(
404
,
'
Invalid path.
'
)
except
:
except
:
exc_type
,
exc_value
,
exc_traceback
=
sys
.
exc_info
()
exc_type
,
exc_value
,
exc_traceback
=
sys
.
exc_info
()
print
"
[openwebrx-httpd] e
xception happened
(outside):
"
,
exc_type
,
exc_value
print
"
[openwebrx-httpd] e
rror
(
@
outside):
"
,
exc_type
,
exc_value
traceback
.
print_tb
(
exc_traceback
)
traceback
.
print_tb
(
exc_traceback
)
class
ClientNotFoundException
(
Exception
):
class
ClientNotFoundException
(
Exception
):
pass
pass
...
...
This diff is collapsed.
Click to expand it.
plugins/dsp/csdr/plugin.py
+
1
−
1
View file @
5d38c210
...
@@ -13,7 +13,7 @@ class dsp_plugin:
...
@@ -13,7 +13,7 @@ class dsp_plugin:
self
.
offset_freq
=
0
self
.
offset_freq
=
0
self
.
low_cut
=
-
4000
self
.
low_cut
=
-
4000
self
.
high_cut
=
4000
self
.
high_cut
=
4000
self
.
bpf_transition_bw
=
3
0
0
#Hz, and this is a constant
self
.
bpf_transition_bw
=
3
2
0
#Hz, and this is a constant
self
.
ddc_transition_bw_rate
=
0.15
# of the IF sample rate
self
.
ddc_transition_bw_rate
=
0.15
# of the IF sample rate
self
.
running
=
False
self
.
running
=
False
chain_begin
=
"
nc localhost 4951 | csdr convert_u8_f | csdr shift_addition_cc --fifo {shift_pipe} | csdr fir_decimate_cc {decimation} {ddc_transition_bw} HAMMING | csdr bandpass_fir_fft_cc --fifo {bpf_pipe} {bpf_transition_bw} HAMMING |
"
chain_begin
=
"
nc localhost 4951 | csdr convert_u8_f | csdr shift_addition_cc --fifo {shift_pipe} | csdr fir_decimate_cc {decimation} {ddc_transition_bw} HAMMING | csdr bandpass_fir_fft_cc --fifo {bpf_pipe} {bpf_transition_bw} HAMMING |
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment