--- ./syslog-ng-ctl/control-client-unix.c_orig	2025-04-20 07:56:41.563634185 -0400
+++ ./syslog-ng-ctl/control-client-unix.c	2025-04-20 10:37:10.318829214 -0400
@@ -72,27 +72,31 @@
       close(self->control_fd);
       goto error;
     }
-  self->control_socket = fdopen(self->control_fd, "r+");
 error:
   g_sockaddr_unref(saddr);
-  return !!self->control_socket;
+  return !!self->control_fd;
 }
 
 gint
 control_client_send_command(ControlClient *self, const gchar *cmd)
 {
-  return fwrite(cmd, strlen(cmd), 1, self->control_socket);
+  return write(self->control_fd, cmd, strlen(cmd));
 }
 
 #define BUFF_LEN 8192
+#define BUFF_LEN1 20648
 
 gint
 control_client_read_reply(ControlClient *self, CommandResponseHandlerFunc response_handler, gpointer user_data)
 {
   gint retval = 0;
   gchar buf[BUFF_LEN], *line;
+  gchar buffer[BUFF_LEN1]; 
   GString *chunk = g_string_sized_new(256);
 
+  recv(self->control_fd, buffer, sizeof(buffer),0);
+  self->control_socket = fmemopen(buffer,strlen(buffer),"r+");
+
   while (1)
     {
       line = fgets(buf, sizeof(buf), self->control_socket);
