summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Brière <fbriere@fbriere.net>2019-09-29 00:07:00 -0400
committerFrédéric Brière <fbriere@fbriere.net>2019-12-27 02:28:12 -0500
commit21ad823ba038f28a58f0f660cc7ebe902dd459b8 (patch)
treec0f2de7109a267c3e0c99f6e12b8d7b6a71ca0c7
parent91de36717a119f9501698af97550bfcdffd2875a (diff)
downloadtwinkle-21ad823ba038f28a58f0f660cc7ebe902dd459b8.tar
twinkle-21ad823ba038f28a58f0f660cc7ebe902dd459b8.tar.gz
twinkle-21ad823ba038f28a58f0f660cc7ebe902dd459b8.tar.lz
twinkle-21ad823ba038f28a58f0f660cc7ebe902dd459b8.tar.xz
twinkle-21ad823ba038f28a58f0f660cc7ebe902dd459b8.zip
Fix "INVITE with Replaces header" deadlock
This occurs on reception of an INVITE with a Replaces header, due to the following path: - recvd_invite() acquires a read lock on lines_mtx - recvd_initial_invite() is called - A write lock over lines_mtx is acquired
-rw-r--r--src/phone.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/phone.cpp b/src/phone.cpp
index 8de3834..a609bef 100644
--- a/src/phone.cpp
+++ b/src/phone.cpp
@@ -905,7 +905,7 @@ void t_phone::post_process_response(t_response *r, t_tuid tuid, t_tid tid) {
}
void t_phone::recvd_invite(t_request *r, t_tid tid) {
- t_rwmutex_reader x(lines_mtx);
+ t_rwmutex_future_writer x(lines_mtx);
// Check if this INVITE is a retransmission.
// Once the TU sent a 2XX repsonse on an INVITE it has to deal