nxt_cgo_lib.c (1544:05af370e63b7) nxt_cgo_lib.c (1547:cbcd76704c90)
1
2/*
3 * Copyright (C) Max Romanov
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include "_cgo_export.h"
8

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

39
40 init.data = (void *) handler;
41
42 ctx = nxt_unit_init(&init);
43 if (ctx == NULL) {
44 return NXT_UNIT_ERROR;
45 }
46
1
2/*
3 * Copyright (C) Max Romanov
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include "_cgo_export.h"
8

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

39
40 init.data = (void *) handler;
41
42 ctx = nxt_unit_init(&init);
43 if (ctx == NULL) {
44 return NXT_UNIT_ERROR;
45 }
46
47 rc = nxt_unit_run(ctx);
47 rc = nxt_unit_run_ctx(ctx);
48
49 nxt_unit_done(ctx);
50
51 return rc;
52}
53
54
55static void

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

100
101 return dst;
102}
103
104
105static int
106nxt_cgo_add_port(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port)
107{
48
49 nxt_unit_done(ctx);
50
51 return rc;
52}
53
54
55static void

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

100
101 return dst;
102}
103
104
105static int
106nxt_cgo_add_port(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port)
107{
108 nxt_go_add_port(port->id.pid, port->id.id,
108 nxt_go_add_port((uintptr_t) ctx, port->id.pid, port->id.id,
109 port->in_fd, port->out_fd);
110
111 port->in_fd = -1;
112 port->out_fd = -1;
113
114 return NXT_UNIT_OK;
115}
116

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

199void
200nxt_cgo_request_done(uintptr_t req, int res)
201{
202 nxt_unit_request_done((nxt_unit_request_info_t *) req, res);
203}
204
205
206void
109 port->in_fd, port->out_fd);
110
111 port->in_fd = -1;
112 port->out_fd = -1;
113
114 return NXT_UNIT_OK;
115}
116

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

199void
200nxt_cgo_request_done(uintptr_t req, int res)
201{
202 nxt_unit_request_done((nxt_unit_request_info_t *) req, res);
203}
204
205
206void
207nxt_cgo_unit_run_shared(uintptr_t ctx)
208{
209 nxt_unit_run_shared((nxt_unit_ctx_t *) ctx);
210}
211
212
213void
207nxt_cgo_warn(uintptr_t msg, uint32_t msg_len)
208{
209 nxt_unit_warn(NULL, "%.*s", (int) msg_len, (char *) msg);
210}
214nxt_cgo_warn(uintptr_t msg, uint32_t msg_len)
215{
216 nxt_unit_warn(NULL, "%.*s", (int) msg_len, (char *) msg);
217}