Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iiod: Update read_line() to work with UART
Previously, in the non-socket case, read_line() would read as much data as possible in one read() call. As it was used almost exclusively for USB, the amount of data returned always corresponded to the size of the bulk data sent by the client, aka. a full line and nothing more. With UART though, if we try reading as much data as possible, we might get just that, and end up reading much more data than we need, disrupting the protocol. Fix this by reading character by character until the \n is found in the non-socket, non-USB case. Signed-off-by: Paul Cercueil <[email protected]>
- Loading branch information