diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-09-06 02:30:55 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-09-06 02:30:55 +0300 |
commit | 58907888e510f6907513da2ea4506ee78b9bf77c (patch) | |
tree | 1d16cf9fb4ad4d21c23b3c825c48408b75a13ef4 /src/nxt_port_rpc.c | |
parent | 22ae3d4ff55ae778688a89c585b5da8eddce6cc0 (diff) | |
download | unit-58907888e510f6907513da2ea4506ee78b9bf77c.tar.gz unit-58907888e510f6907513da2ea4506ee78b9bf77c.tar.bz2 |
Style fixes.
Diffstat (limited to 'src/nxt_port_rpc.c')
-rw-r--r-- | src/nxt_port_rpc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nxt_port_rpc.c b/src/nxt_port_rpc.c index 6f31a296..c5821439 100644 --- a/src/nxt_port_rpc.c +++ b/src/nxt_port_rpc.c @@ -67,8 +67,7 @@ nxt_port_rpc_register_handler(nxt_task_t *task, nxt_port_t *port, nxt_port_rpc_reg_t *reg; nxt_lvlhsh_query_t lhq; - - nxt_assert(port->pair[0] != -1); + nxt_assert(port->pair[0] != -1); stream = port->next_stream++; @@ -158,6 +157,7 @@ nxt_port_rpc_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) if (last != 0) { ret = nxt_lvlhsh_delete(&port->rpc_streams, &lhq); + } else { ret = nxt_lvlhsh_find(&port->rpc_streams, &lhq); } @@ -176,6 +176,7 @@ nxt_port_rpc_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) if (type == _NXT_PORT_MSG_RPC_ERROR) { reg->error_handler(task, msg, reg->data); + } else { reg->ready_handler(task, msg, reg->data); } @@ -197,6 +198,7 @@ nxt_port_rpc_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) nxt_log_error(NXT_LOG_ERR, task->log, "rpc: failed to delete " "peer %PI", reg->peer); } + } else { nxt_queue_remove(®->link); } @@ -262,8 +264,9 @@ nxt_port_rpc_remove_peer(nxt_task_t *task, nxt_port_t *port, nxt_pid_t peer) ret = nxt_lvlhsh_delete(&port->rpc_streams, &lhq); if (nxt_slow_path(ret != NXT_OK)) { - nxt_log_error(NXT_LOG_ERR, task->log, "rpc: failed to delete " - "handler for stream #%uD", stream); + nxt_log_error(NXT_LOG_ERR, task->log, + "rpc: failed to delete handler for stream #%uD", + stream); return; } @@ -309,9 +312,10 @@ nxt_port_rpc_cancel(nxt_task_t *task, nxt_port_t *port, uint32_t stream) ret = nxt_lvlhsh_delete(&port->rpc_peers, &lhq); if (nxt_slow_path(ret != NXT_OK)) { - nxt_log_error(NXT_LOG_ERR, task->log, "rpc: failed to delete " - "peer %PI", reg->peer); + nxt_log_error(NXT_LOG_ERR, task->log, + "rpc: failed to delete peer %PI", reg->peer); } + } else { nxt_queue_remove(®->link); } |