mirror of
https://github.com/schoebel/mars
synced 2024-12-26 00:22:31 +00:00
client: fix communication protocol error
This commit is contained in:
parent
5c7a3c95cc
commit
e4d2567eed
@ -300,9 +300,20 @@ int receiver_thread(void *data)
|
||||
struct mref_object *mref = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
if (output->recv_error) {
|
||||
/* The protocol may be out of sync.
|
||||
* Consume some data to avoid distributed deadlocks.
|
||||
*/
|
||||
(void)mars_recv_raw(&output->socket, &cmd, 0, sizeof(cmd));
|
||||
wake_up_interruptible(&output->event);
|
||||
brick_msleep(100);
|
||||
status = output->recv_error;
|
||||
continue;
|
||||
}
|
||||
|
||||
status = mars_recv_struct(&output->socket, &cmd, mars_cmd_meta);
|
||||
MARS_IO("got cmd = %d status = %d\n", cmd.cmd_code, status);
|
||||
if (status < 0)
|
||||
if (status <= 0)
|
||||
goto done;
|
||||
|
||||
switch (cmd.cmd_code & CMD_FLAG_MASK) {
|
||||
|
Loading…
Reference in New Issue
Block a user