diff mbox series

[BlueZ,v1,1/2] sco-tester: Fix closing the socket

Message ID 20250311194226.15109-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1,1/2] sco-tester: Fix closing the socket | expand

Commit Message

Luiz Augusto von Dentz March 11, 2025, 7:42 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When writting data the socket shall not be closed until all the data
could be transmitted or the test times out.
---
 tools/sco-tester.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/tools/sco-tester.c b/tools/sco-tester.c
index e6888348bfab..b88631d89034 100644
--- a/tools/sco-tester.c
+++ b/tools/sco-tester.c
@@ -821,6 +821,9 @@  static gboolean sco_connect_cb(GIOChannel *io, GIOCondition cond,
 					errno);
 			err = -errno;
 		}
+
+		/* Don't close the socket until all data is sent */
+		g_io_channel_set_close_on_unref(io, FALSE);
 	}
 
 	if (scodata->shutdown) {