mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 15:05:59 +01:00
parent
2e26542e3b
commit
016a7a9c9b
1 changed files with 16 additions and 9 deletions
|
@ -1390,7 +1390,7 @@ int hyprCtlFDTick(int fd, uint32_t mask, void* data) {
|
||||||
|
|
||||||
const auto ACCEPTEDCONNECTION = accept4(HyprCtl::iSocketFD, (sockaddr*)&clientAddress, &clientSize, SOCK_CLOEXEC);
|
const auto ACCEPTEDCONNECTION = accept4(HyprCtl::iSocketFD, (sockaddr*)&clientAddress, &clientSize, SOCK_CLOEXEC);
|
||||||
|
|
||||||
char readBuffer[1024];
|
std::array<char, 1024> readBuffer;
|
||||||
|
|
||||||
fd_set fdset;
|
fd_set fdset;
|
||||||
FD_ZERO(&fdset);
|
FD_ZERO(&fdset);
|
||||||
|
@ -1403,10 +1403,17 @@ int hyprCtlFDTick(int fd, uint32_t mask, void* data) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto messageSize = read(ACCEPTEDCONNECTION, readBuffer, 1024);
|
std::string request;
|
||||||
readBuffer[messageSize == 1024 ? 1023 : messageSize] = '\0';
|
while (true) {
|
||||||
|
readBuffer.fill(0);
|
||||||
std::string request(readBuffer);
|
auto messageSize = read(ACCEPTEDCONNECTION, readBuffer.data(), 1023);
|
||||||
|
if (messageSize < 1)
|
||||||
|
break;
|
||||||
|
std::string recvd = readBuffer.data();
|
||||||
|
request += recvd;
|
||||||
|
if (messageSize < 1023)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
std::string reply = "";
|
std::string reply = "";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue