Extract peer connect and read-write loop into a separate file (to be shared with the client library)

This commit is contained in:
Vitaliy Filippov
2020-05-26 22:11:30 +03:00
parent fa98be6bc0
commit 0aca6e9ca8
14 changed files with 718 additions and 706 deletions
+3 -3
View File
@@ -366,7 +366,7 @@ resume_7:
}
// Remember PG as dirty to drop the connection when PG goes offline
// (this is required because of the "lazy sync")
this->clients[cur_op->peer_fd].dirty_pgs.insert(op_data->pg_num);
c_cli.clients[cur_op->peer_fd].dirty_pgs.insert(op_data->pg_num);
dirty_pgs.insert(op_data->pg_num);
}
return true;
@@ -519,8 +519,8 @@ resume_6:
finish:
if (cur_op->peer_fd)
{
auto it = clients.find(cur_op->peer_fd);
if (it != clients.end())
auto it = c_cli.clients.find(cur_op->peer_fd);
if (it != c_cli.clients.end())
it->second.dirty_pgs.clear();
}
finish_op(cur_op, 0);