From 46e51a81c4c457078ac144c010d9d4d64d02f9df Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 26 Oct 2022 13:11:05 +0100 Subject: unrestrict hyprctl message size --- hyprctl/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'hyprctl') diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index d407f206..a216b1a0 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -80,6 +80,7 @@ void request(std::string arg) { return; } + std::string reply = ""; char buffer[8192] = {0}; sizeWritten = read(SERVERSOCKET, buffer, 8192); @@ -89,9 +90,20 @@ void request(std::string arg) { return; } + reply += std::string(buffer, sizeWritten); + + while (sizeWritten == 8192) { + sizeWritten = read(SERVERSOCKET, buffer, 8192); + if (sizeWritten < 0) { + std::cout << "Couldn't read (5)"; + return; + } + reply += std::string(buffer, sizeWritten); + } + close(SERVERSOCKET); - std::cout << std::string(buffer); + std::cout << reply; } void requestHyprpaper(std::string arg) { -- cgit v1.2.3