summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port.h
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2021-11-09 15:48:44 +0300
committerTiago Natel de Moura <t.nateldemoura@f5.com>2021-11-09 15:48:44 +0300
commitff6a7053f500414dc74568a4e49adbac7f0cf634 (patch)
treecda31505e9746138fb864a6b2902b89107e04bc7 /src/nxt_port.h
parente878f6d54376ea676b96b56f41708f01cfc4d8b4 (diff)
downloadunit-ff6a7053f500414dc74568a4e49adbac7f0cf634.tar.gz
unit-ff6a7053f500414dc74568a4e49adbac7f0cf634.tar.bz2
Introduced SCM_CREDENTIALS / SCM_CREDS in the socket control msgs.
Diffstat (limited to 'src/nxt_port.h')
-rw-r--r--src/nxt_port.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/nxt_port.h b/src/nxt_port.h
index c698a49c..d7fc8d73 100644
--- a/src/nxt_port.h
+++ b/src/nxt_port.h
@@ -153,7 +153,9 @@ typedef enum {
/* Passed as a first iov chunk. */
typedef struct {
uint32_t stream;
- nxt_pid_t pid;
+
+ nxt_pid_t pid; /* not used on Linux and FreeBSD */
+
nxt_port_id_t reply_port;
uint8_t type;
@@ -186,6 +188,9 @@ typedef struct {
uint8_t allocated; /* 1 bit */
} nxt_port_send_msg_t;
+#if (NXT_HAVE_UCRED) || (NXT_HAVE_MSGHDR_CMSGCRED)
+#define NXT_USE_CMSG_PID 1
+#endif
struct nxt_port_recv_msg_s {
nxt_fd_t fd[2];
@@ -193,6 +198,9 @@ struct nxt_port_recv_msg_s {
nxt_port_t *port;
nxt_port_msg_t port_msg;
size_t size;
+#if (NXT_USE_CMSG_PID)
+ nxt_pid_t cmsg_pid;
+#endif
nxt_bool_t cancelled;
union {
nxt_port_t *new_port;
@@ -201,6 +209,15 @@ struct nxt_port_recv_msg_s {
} u;
};
+
+#if (NXT_USE_CMSG_PID)
+#define nxt_recv_msg_cmsg_pid(msg) ((msg)->cmsg_pid)
+#define nxt_recv_msg_cmsg_pid_ref(msg) (&(msg)->cmsg_pid)
+#else
+#define nxt_recv_msg_cmsg_pid(msg) ((msg)->port_msg.pid)
+#define nxt_recv_msg_cmsg_pid_ref(msg) (NULL)
+#endif
+
typedef struct nxt_app_s nxt_app_t;
struct nxt_port_s {