Correctly check for end-of-lines in Blender connection

pull/216/head
James Ball 2024-01-31 16:53:58 +00:00 zatwierdzone przez James H Ball
rodzic a83cc33a76
commit 4a97c317f9
2 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -38,11 +38,13 @@ void ObjectServer::run() {
std::memcpy(message.get() + i, buffer, bytesRead); std::memcpy(message.get() + i, buffer, bytesRead);
i += bytesRead; i += bytesRead;
if (message[i] == '\n') { for (int j = i - bytesRead; j < i; j++) {
message[i] = '\0'; if (message[j] == '\n') {
message[j] = '\0';
break; break;
} }
} }
}
if (strncmp(message.get(), "CLOSE", 5) == 0) { if (strncmp(message.get(), "CLOSE", 5) == 0) {
connection->close(); connection->close();

Wyświetl plik

@ -5,7 +5,7 @@
pluginCharacteristicsValue="pluginProducesMidiOut,pluginWantsMidiIn" pluginCharacteristicsValue="pluginProducesMidiOut,pluginWantsMidiIn"
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender" pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
cppLanguageStandard="20" projectLineFeed="&#10;" headerPath="./include" cppLanguageStandard="20" projectLineFeed="&#10;" headerPath="./include"
version="2.0.7" companyName="James H Ball" companyWebsite="https://osci-render.com" version="2.0.8" companyName="James H Ball" companyWebsite="https://osci-render.com"
companyEmail="james@ball.sh"> companyEmail="james@ball.sh">
<MAINGROUP id="j5Ge2T" name="osci-render"> <MAINGROUP id="j5Ge2T" name="osci-render">
<GROUP id="{5ABCED88-0059-A7AF-9596-DBF91DDB0292}" name="Resources"> <GROUP id="{5ABCED88-0059-A7AF-9596-DBF91DDB0292}" name="Resources">