Fix bug in driver
This commit is contained in:
@@ -95,7 +95,6 @@ public:
|
|||||||
StreamBuffer *sb = channel_->out();
|
StreamBuffer *sb = channel_->out();
|
||||||
sb->write_uint8(util::MSG_INVOKE);
|
sb->write_uint8(util::MSG_INVOKE);
|
||||||
inv.serialize(sb);
|
inv.serialize(sb);
|
||||||
util::dprint("Sent ", inv.debug_string());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_lua_source(const util::LuaSourceVec &sv) {
|
void send_lua_source(const util::LuaSourceVec &sv) {
|
||||||
@@ -228,7 +227,6 @@ public:
|
|||||||
receive_ack_from_server(&body);
|
receive_ack_from_server(&body);
|
||||||
} else if (message_type == util::MSG_DIFF) {
|
} else if (message_type == util::MSG_DIFF) {
|
||||||
receive_diff_from_server(&body);
|
receive_diff_from_server(&body);
|
||||||
util::dprintf("Executed diff from server");
|
|
||||||
} else {
|
} else {
|
||||||
abandon_server();
|
abandon_server();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public:
|
|||||||
sb->write_uint8(util::MSG_DIFF);
|
sb->write_uint8(util::MSG_DIFF);
|
||||||
sb->write_uint32(0);
|
sb->write_uint32(0);
|
||||||
int64_t tw_1 = sb->total_writes();
|
int64_t tw_1 = sb->total_writes();
|
||||||
stdostream() << "Sending diffs to client " << client->actor_id_ << std::endl;
|
//stdostream() << "Sending diffs to client " << client->actor_id_ << std::endl;
|
||||||
client->sync_->diff_everything(client->actor_id_, master_.get(), sb);
|
client->sync_->diff_everything(client->actor_id_, master_.get(), sb);
|
||||||
int64_t tw_2 = sb->total_writes();
|
int64_t tw_2 = sb->total_writes();
|
||||||
sb->overwrite_int32(tw_1, tw_2 - tw_1);
|
sb->overwrite_int32(tw_1, tw_2 - tw_1);
|
||||||
@@ -150,12 +150,11 @@ public:
|
|||||||
delete_client(client);
|
delete_client(client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
util::dprint("Received ", inv.debug_string());
|
|
||||||
if (inv.actor() != client->actor_id_) {
|
if (inv.actor() != client->actor_id_) {
|
||||||
stdostream() << "Ignoring invoke with wrong actor ID " << inv.actor() << std::endl;
|
stdostream() << "Ignoring invoke with wrong actor ID " << inv.actor() << std::endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
stdostream() << "Invoking: " << inv.debug_string() << std::endl;
|
//stdostream() << "Invoking: " << inv.debug_string() << std::endl;
|
||||||
master_->invoke(inv);
|
master_->invoke(inv);
|
||||||
client->channel_->out()->write_uint8(util::MSG_ACK);
|
client->channel_->out()->write_uint8(util::MSG_ACK);
|
||||||
client->channel_->out()->write_uint32(0);
|
client->channel_->out()->write_uint32(0);
|
||||||
|
|||||||
@@ -444,6 +444,9 @@ class Driver {
|
|||||||
bool any_released = false;
|
bool any_released = false;
|
||||||
for (ChanInfo &chan : chans_) {
|
for (ChanInfo &chan : chans_) {
|
||||||
engw.get_outgoing(&engw, chan.chid, &chan.nbytes, &chan.bytes);
|
engw.get_outgoing(&engw, chan.chid, &chan.nbytes, &chan.bytes);
|
||||||
|
if (chan.nbytes > 0) {
|
||||||
|
chan.need_advance = true;
|
||||||
|
}
|
||||||
if (chan.nbytes == 0) {
|
if (chan.nbytes == 0) {
|
||||||
if (engw.get_channel_released(&engw, chan.chid)) {
|
if (engw.get_channel_released(&engw, chan.chid)) {
|
||||||
close_channel(chan, "");
|
close_channel(chan, "");
|
||||||
|
|||||||
Reference in New Issue
Block a user