mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-19 12:32:29 +00:00
Fix bogus "Invalid magic" message when socket connection is established (#988)
This commit is contained in:
parent
4645e8c975
commit
8c5dcd2f49
@ -123,8 +123,12 @@ PbCommand RascsiService::ReadCommand(CommandContext& context) const
|
||||
|
||||
// Read magic string
|
||||
vector<byte> magic(6);
|
||||
if (const size_t bytes_read = context.GetSerializer().ReadBytes(fd, magic);
|
||||
bytes_read != magic.size() || memcmp(magic.data(), "RASCSI", magic.size())) {
|
||||
const size_t bytes_read = context.GetSerializer().ReadBytes(fd, magic);
|
||||
if (!bytes_read) {
|
||||
return command;
|
||||
}
|
||||
|
||||
if (bytes_read != magic.size() || memcmp(magic.data(), "RASCSI", magic.size())) {
|
||||
throw io_exception("Invalid magic");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user