From 81b7ef801c7f83d00dd1325b0a86275687a8687c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr>
Date: Mon, 28 Mar 2022 16:15:33 +0200
Subject: [PATCH] [server/socket] force flushing bsnd on polling

---
 src/plugins/server/server_socket.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/server/server_socket.ml b/src/plugins/server/server_socket.ml
index 13453b4fb28..ad9fd893d89 100644
--- a/src/plugins/server/server_socket.ml
+++ b/src/plugins/server/server_socket.ml
@@ -118,7 +118,6 @@ let write_data ch data =
     in
     Buffer.add_string ch.bsnd hex ;
     Buffer.add_string ch.bsnd data ;
-    send_bytes ch ;
   end
 
 (* -------------------------------------------------------------------------- *)
@@ -190,7 +189,8 @@ let callback ch rs =
        | data -> write_data ch data
        | exception err ->
          Senv.debug "Socket: encoding error %S@." (Printexc.to_string err)
-    ) rs
+    ) rs ;
+  send_bytes ch
 
 let commands ch =
   begin
-- 
GitLab