Add client reset step in OnTimedOut() 31/284631/3
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 22 Nov 2022 05:29:40 +0000 (14:29 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 22 Nov 2022 08:28:45 +0000 (08:28 +0000)
If the timeout occurs between OnAppeared and Connected events,
even if try to reconnect, the port may not be valid.
After applying this patch, the client is reset to protect the possibility of accessing invalid ports.

Change-Id: Ic268bac9f899f96c2ceda196f5def1abdd624159
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/proxy-internal.cc

index 7816276d4667629c5d326af909db5d48d9ad8601..518c436ccaa3fb343e16062dfe9babd51950c899 100644 (file)
@@ -442,6 +442,8 @@ gboolean Proxy::OnTimedOut(gpointer user_data) {
   }
 
   proxy->Cancel();
+  proxy->main_client_.reset();
+  proxy->delegate_client_.reset();
   DestroyWeakPtr(proxy->conn_timer_data_);
   proxy->conn_timer_data_ = nullptr;