nxt_unit.c (1756:72e75ce3c99f) nxt_unit.c (1767:582a004c73f8)
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <stdlib.h>
7
8#include "nxt_main.h"

--- 5002 unchanged lines hidden (view full) ---

5011
5012
5013static int
5014nxt_unit_process_port_msg_impl(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port)
5015{
5016 int rc;
5017 nxt_unit_impl_t *lib;
5018 nxt_unit_read_buf_t *rbuf;
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <stdlib.h>
7
8#include "nxt_main.h"

--- 5002 unchanged lines hidden (view full) ---

5011
5012
5013static int
5014nxt_unit_process_port_msg_impl(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port)
5015{
5016 int rc;
5017 nxt_unit_impl_t *lib;
5018 nxt_unit_read_buf_t *rbuf;
5019 nxt_unit_ctx_impl_t *ctx_impl;
5020
5021 rbuf = nxt_unit_read_buf_get(ctx);
5022 if (nxt_slow_path(rbuf == NULL)) {
5023 return NXT_UNIT_ERROR;
5024 }
5025
5026 lib = nxt_container_of(ctx->unit, nxt_unit_impl_t, unit);
5019
5020 rbuf = nxt_unit_read_buf_get(ctx);
5021 if (nxt_slow_path(rbuf == NULL)) {
5022 return NXT_UNIT_ERROR;
5023 }
5024
5025 lib = nxt_container_of(ctx->unit, nxt_unit_impl_t, unit);
5027 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx);
5028
5026
5029retry:
5030
5031 if (port == lib->shared_port) {
5032 rc = nxt_unit_shared_port_recv(ctx, port, rbuf);
5033
5034 } else {
5035 rc = nxt_unit_ctx_port_recv(ctx, port, rbuf);
5036 }
5037
5038 if (rc != NXT_UNIT_OK) {

--- 8 unchanged lines hidden (view full) ---

5047
5048 rc = nxt_unit_process_pending_rbuf(ctx);
5049 if (nxt_slow_path(rc == NXT_UNIT_ERROR)) {
5050 return NXT_UNIT_ERROR;
5051 }
5052
5053 nxt_unit_process_ready_req(ctx);
5054
5027 if (port == lib->shared_port) {
5028 rc = nxt_unit_shared_port_recv(ctx, port, rbuf);
5029
5030 } else {
5031 rc = nxt_unit_ctx_port_recv(ctx, port, rbuf);
5032 }
5033
5034 if (rc != NXT_UNIT_OK) {

--- 8 unchanged lines hidden (view full) ---

5043
5044 rc = nxt_unit_process_pending_rbuf(ctx);
5045 if (nxt_slow_path(rc == NXT_UNIT_ERROR)) {
5046 return NXT_UNIT_ERROR;
5047 }
5048
5049 nxt_unit_process_ready_req(ctx);
5050
5055 if (ctx_impl->online) {
5056 rbuf = nxt_unit_read_buf_get(ctx);
5057 if (nxt_slow_path(rbuf == NULL)) {
5058 return NXT_UNIT_ERROR;
5059 }
5060
5061 goto retry;
5062 }
5063
5064 return rc;
5065}
5066
5067
5068void
5069nxt_unit_done(nxt_unit_ctx_t *ctx)
5070{
5071 nxt_unit_ctx_release(ctx);

--- 1647 unchanged lines hidden ---
5051 return rc;
5052}
5053
5054
5055void
5056nxt_unit_done(nxt_unit_ctx_t *ctx)
5057{
5058 nxt_unit_ctx_release(ctx);

--- 1647 unchanged lines hidden ---