mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-22 15:30:09 +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
|
// Read magic string
|
||||||
vector<byte> magic(6);
|
vector<byte> magic(6);
|
||||||
if (const size_t bytes_read = context.GetSerializer().ReadBytes(fd, magic);
|
const size_t bytes_read = context.GetSerializer().ReadBytes(fd, magic);
|
||||||
bytes_read != magic.size() || memcmp(magic.data(), "RASCSI", magic.size())) {
|
if (!bytes_read) {
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bytes_read != magic.size() || memcmp(magic.data(), "RASCSI", magic.size())) {
|
||||||
throw io_exception("Invalid magic");
|
throw io_exception("Invalid magic");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user