summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_upstream.h
blob: d1fca2a5e95e19ffaa9e20b8e44560c534c36b87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

/*
 * 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_mp_t        *mem_pool;
    void            (*ready_handler)(nxt_task_t *task, 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_task_t *task,
    nxt_upstream_peer_t *up);
/**/


#endif /* _NXT_UPSTREAM_H_INCLUDED_ */