Deleted Added
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);
5027 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx);
5028
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
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 ---