Fix test rw_blocking

This commit is contained in:
Vitaliy Filippov
2021-12-12 23:24:50 +03:00
parent 616c18c786
commit e544aef7d0
2 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -116,7 +116,7 @@ int bind_stub(const char *bind_address, int bind_port)
void run_stub(int peer_fd)
{
osd_any_op_t op;
osd_any_reply_t reply;
osd_any_reply_t reply = { 0 };
void *buf = NULL;
while (1)
{
@@ -139,7 +139,7 @@ void run_stub(int peer_fd)
buf = malloc(op.sec_rw.len);
r = write_blocking(peer_fd, reply.buf, OSD_PACKET_SIZE);
if (r == OSD_PACKET_SIZE)
r = write_blocking(peer_fd, &buf, op.sec_rw.len);
r = write_blocking(peer_fd, buf, op.sec_rw.len);
free(buf);
if (r < op.sec_rw.len)
break;