79 Commits (b87c46a273c1bde5ef76bbdabc9069c0991005fe)

Author SHA1 Message Date
Adam Honse d09c66900d Set TCP_QUICKACK on Linux to improve responsiveness when using client/service configuration 4 months ago
Egor Vorontsov 56b75aaffc
Set `SO_REUSEADDR` on network sockets. 5 months ago
Adam Honse a6b890a48d Use ResourceManager::RescanDevices() to initiate a rescan in places where ResourceManager::DetectDevices() was still being used 6 months ago
Adam Honse c71cc4f18a Change SPDX license identifier from GPL 2.0 only to GPL 2.0 or later, as the original LICENSE file includes an or later clause at the end so the file headers were incorrect 7 months ago
Adam Honse df73d0263a Add send_in_progress locks around send groups in NetworkServer.cpp 10 months ago
Adam Honse 0cfe5ae0bb Add SDK command to rescan devices 10 months ago
Adam Honse 85625a37b2 SDK cleanup, update SDK documentation 1 year ago
Adam Honse 1967ec9526 Save sizes file when server processes segment changes 1 year ago
Adam Honse 012cb5e62d Fix segment creation and modification over the network protocol 1 year ago
Adam Honse ff2188ba45 Update SDK Documentation, fix plugin protocol version type in NetworkServer 1 year ago
morg 59e303c882 Add missing tags in logs 1 year ago
Adam Honse 471f9d3e2e Add server option to disable the size check called legacy workaround, which can be enabled to allow some old SDK apps that didn't properly implement the size to still be used 1 year ago
Adam Honse 39c968ff2a Fix some warnings in NetworkServer.cpp 1 year ago
Adam Honse c1149da754 Fix possible loss of data warnings in NetworkServer.cpp 2 years ago
Adam Honse fdd04a1511 Allow data size of zero for data length checks if protocol version is 4 or lower, this is to fix backwards compatibility with a bug in older versions OpenRGB.NET that has since been fixed. 2 years ago
Adam Honse e7240ecca0 Improve logging in NetworkServer.cpp and close listener if any packet with an invalid size is received 2 years ago
Adam Honse 64a0d2c061 Add some size checks on the server to ensure received data matches the size from the packet header 2 years ago
Adam Honse a7c400bc65 Update yet more file header comments to standardized new format 2 years ago
Adam Honse 89983dcdd1 Process received magic using a loop in client and server 2 years ago
Adam Honse cf4fd16b09 Define SDK magic string value as a shared constant in NetworkProtocol.cpp, use InitNetPacketHeader function to set up packets 2 years ago
Adam Honse 9215ae0514 Clean up comment formatting in NetworkServer.cpp 2 years ago
Adam Honse d7ed55b264 Use size when parsing received buffers into strings in NetworkServer 3 years ago
Jack e15b299684 SDK Plugins Fix 3 years ago
Jack 4baf19f13a SDK plugin control 3 years ago
B Horn a54f03e199 Fixing MacOS / Clang builds 4 years ago
B Horn 640eb7905c SDK Listening Options 4 years ago
Chris f3eac499d4 Allow for server side controller resizing
* Save sizes profile on the server
* Update RGBController_Network size on the client
4 years ago
Alex 4af8614fce Add formated loging for device detection
Commits merged and amended for code style by Adam Honse <calcprogrammer1@gmail.com>
5 years ago
Adam Honse 5130f07e21 Add saving support to network protocol 5 years ago
Chris a46eccef3c Added brightness to profile loading and saving
* Bumped profile version to 3
* Loading a v1/v2 profile onto a device with brightness will work
* Loading a v3 profile onto a device without brightness also works
* Add profile version parameter to Get/SetModeDescription

Commit amended for code style and to update versioning by Adam Honse <calcprogrammer1@gmail.com>
5 years ago
k1-801 65623d3978 Autoclose updated
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
5 years ago
k1-801 abfb6ea22d Tiny fixups (server conn info leak closed, log va leak closed, config dir optimized)
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
5 years ago
k1-801 02ba8a799e Server freed from ResourceManager
Commit amended to revert OpenRGBInterfaces.h header (may reconsider in the future) by Adam Honse
<calcprogrammer1@gmail.com>
5 years ago
Gabriel Marcano 30f88d5fcf Fix mismatched new[] / delete
- The device description buffer was allocated using new[] in
   RGBController. Make sure to free it using delete[].
5 years ago
morg 8ef9f622f1 Fix memory leak (RGBController::GetDeviceDescription) 5 years ago
morg 79dacbaeb0 Fix crash on server stop
Commit amended to initialize listening variable by Adam Honse <calcprogrammer1@gmail.com>
5 years ago
morg e2bc1003e6 Add profile management to SDK
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
5 years ago
Adam Honse 72da8f362c SDK protocol versioning implemented. Protocol updated to version 1 which adds vendor string to controller request. 6 years ago
k1-801 dde857dfb4 Tiny threads fixes & a little bit of safety 6 years ago
Adam Honse c3b4489fd3 Fix Windows build 6 years ago
Adam Honse 60fd721586 Server sends a request to the client when the device list is updated 6 years ago
Adam Honse f568253c51 Clean up more warnings 6 years ago
k1-801 8b8451017e Non-important warnings removed
Commit amended by Adam Honse <calcprogrammer1@gmail.com> due to merging from a different branch.
6 years ago
B Horn f02223d6ba Checks to avoid null dereferences in NetworkServer
Various commands in NetworkServer require extra data. However, if the
packet size is set to 0 for these, the code will skip over reading the
data in and allocating memory. This results in null dereferences.

This patch adds checks to the relevant commands to make sure they don't
continue reading a null pointer.
6 years ago
Adam Honse 0ccf2d0c33 Remove some debugging printouts in Network Client and Server code 6 years ago
B Horn 47baeb6b6b Improving NetworkServer's memory management (#373)
This patch resolves several bugs:

* NetworkServer would allocate various instances of `NetworkClientInfo`.
  This is patched by deallocating the NetworkClientInfo when it's
  listening thread ends in the `listen_done` section.

* Memory would be allocated for threads that wouldn't be freed. This
  is resolved by detaching from the threads, so they no longer need to
  be joined to be freed, and then freeing the memory as they finish.

* Thread-Safety issues involving `ServerClients` would result in stray
  `NetworkClientInfo`'s not being removed from the list in certain
  situations. This is resolved by used a mutex to lock access to this
  from different threads.
6 years ago
Adam Honse 96af869d79 Check for local server before detecting devices from hardware and tweak timeouts to make network connections faster 6 years ago
Térence Clastres 1db412e970 Fix high CPU usage when running the SDK server
It was coming from `recv_select()` and `accept_select()`
The timeval struct members for select() is reset after each call to select() for
whatever reason so like FD_ZERO and FD_SET it needs to be placed inside
the loop.

Source: https://stackoverflow.com/questions/3324078/why-select-always-return-0-after-the-first-timeout
6 years ago
Térence Clastres b94f701db8 Fix high CPU usage when running the SDK server
It was coming from `recv_select()` `nd accept_select()`
The timeout for select() is only when waiting for the file descriptor to
be ready for reading/writing so when the FD is ready AND there is
nothing to read, it will not return and instead keep executing the while loop with no timeout.
Fix this by adding a 100ms timeout when there is nothing to read.
6 years ago
Térence Clastres b79ff124e6 Replace Sleep() by std:🧵:sleep_for() 6 years ago