if (conn->remote_conn && short_circuit_ok) {
uint8_t *buf = msg;
size_t n = mlen;
+ bool old;
if (packf) {
buf = XMALLOC(MTYPE_TMP, mlen);
n = packf(msg, buf);
}
+ ++conn->short_circuit_depth;
MGMT_MSG_DBG(dbgtag, "SC send: depth %u msg: %p",
- ++conn->short_circuit_depth, msg);
+ conn->short_circuit_depth, msg);
+ old = conn->remote_conn->is_short_circuit;
+ conn->remote_conn->is_short_circuit = true;
conn->remote_conn->handle_msg(version, buf, n,
conn->remote_conn);
+ conn->remote_conn->is_short_circuit = old;
+ --conn->short_circuit_depth;
MGMT_MSG_DBG(dbgtag, "SC return from depth: %u msg: %p",
- conn->short_circuit_depth--, msg);
+ conn->short_circuit_depth, msg);
if (packf)
XFREE(MTYPE_TMP, buf);
set_nonblocking(sockets[0]);
setsockopt_so_sendbuf(sockets[0], client->conn.mstate.max_write_buf);
setsockopt_so_recvbuf(sockets[0], client->conn.mstate.max_read_buf);
- client->conn.is_short_circuit = true;
/* server side */
memset(&su, 0, sizeof(union sockunion));
server_conn = server->create(sockets[1], &su);
- server_conn->is_short_circuit = true;
client->conn.remote_conn = server_conn;
server_conn->remote_conn = &client->conn;