summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_upstream.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
commit16cbf3c076a0aca6d47adaf3f719493674cf2363 (patch)
treee6530480020f62a2bdbf249988ec3e2a751d3927 /src/nxt_upstream.h
downloadunit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.gz
unit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.bz2
Initial version.
Diffstat (limited to 'src/nxt_upstream.h')
-rw-r--r--src/nxt_upstream.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/nxt_upstream.h b/src/nxt_upstream.h
new file mode 100644
index 00000000..2935ccc8
--- /dev/null
+++ b/src/nxt_upstream.h
@@ -0,0 +1,46 @@
+
+/*
+ * Copyright (C) Igor Sysoev
+ * Copyright (C) NGINX, Inc.
+ */
+
+#ifndef _NXT_UPSTREAM_H_INCLUDED_
+#define _NXT_UPSTREAM_H_INCLUDED_
+
+
+typedef struct nxt_upstream_peer_s nxt_upstream_peer_t;
+
+
+struct nxt_upstream_peer_s {
+ /* STUB */
+ void *upstream;
+ void *data;
+ /**/
+
+ nxt_sockaddr_t *sockaddr;
+ nxt_nsec_t delay;
+
+ uint32_t tries;
+ in_port_t port;
+
+ nxt_str_t addr;
+ nxt_mem_pool_t *mem_pool;
+ void (*ready_handler)(nxt_upstream_peer_t *up);
+
+ void (*protocol_handler)(nxt_upstream_source_t *us);
+};
+
+
+typedef struct {
+ void (*ready_handler)(void *data);
+ nxt_work_handler_t completion_handler;
+ nxt_work_handler_t error_handler;
+} nxt_upstream_state_t;
+
+
+/* STUB */
+NXT_EXPORT void nxt_upstream_round_robin_peer(nxt_upstream_peer_t *up);
+/**/
+
+
+#endif /* _NXT_UPSTREAM_H_INCLUDED_ */