From 8ec0d39ac2c192667c7fd7b0535f90b8c565b51d Mon Sep 17 00:00:00 2001 From: Lukas Holst Date: Wed, 21 Aug 2024 19:37:16 -0400 Subject: [PATCH] lock fix --- Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala b/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala index 91acfc461..4e9160602 100644 --- a/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala +++ b/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala @@ -98,7 +98,9 @@ class WSEndpointClient(host: String, port: Int, connection: WSConnection, val no // examples: 200 tx mode: JSON, 200 subscribed, 200 Sent bundle dtn://global/~crdt/app1-764256828302-0 with 11 bytes // we throw an Exception if this is not the case println(s"received command response: $s") - lock.unlock() + + if s.startsWith("200 Sent payload") then lock.unlock() + if !s.startsWith("200") then println( s"dtn ws command response indicated 'not successfull', further interaction with the ws will likely fail: $s"