Mercurial > hg > nginx
comparison src/event/ngx_event_connect.h @ 884:4d68c486fcb0
upstream choice modules
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 04 Dec 2006 16:46:13 +0000 |
parents | 39b7d7b33c91 |
children | be2b895d31e0 |
comparison
equal
deleted
inserted
replaced
883:eac23634d614 | 884:4d68c486fcb0 |
---|---|
11 #include <ngx_config.h> | 11 #include <ngx_config.h> |
12 #include <ngx_core.h> | 12 #include <ngx_core.h> |
13 #include <ngx_event.h> | 13 #include <ngx_event.h> |
14 | 14 |
15 | 15 |
16 typedef struct { | 16 #define NGX_PEER_KEEPALIVE 1 |
17 ngx_peers_t *peers; | 17 #define NGX_PEER_NEXT 2 |
18 ngx_uint_t cur_peer; | 18 #define NGX_PEER_FAILED 4 |
19 ngx_uint_t tries; | |
20 | 19 |
21 ngx_connection_t *connection; | 20 |
22 #if (NGX_THREADS) | 21 typedef struct ngx_peer_connection_s ngx_peer_connection_t; |
23 ngx_atomic_t *lock; | 22 |
23 typedef ngx_int_t (*ngx_event_get_peer_pt)(ngx_peer_connection_t *pc, | |
24 void *data); | |
25 #if (NGX_SSL) | |
26 typedef void (*ngx_event_save_peer_pt)(ngx_peer_connection_t *pc, void *data); | |
27 #endif | |
28 typedef void (*ngx_event_free_peer_pt)(ngx_peer_connection_t *pc, void *data, | |
29 ngx_uint_t state); | |
30 | |
31 | |
32 struct ngx_peer_connection_s { | |
33 ngx_connection_t *connection; | |
34 | |
35 struct sockaddr *sockaddr; | |
36 socklen_t socklen; | |
37 ngx_str_t *name; | |
38 | |
39 ngx_uint_t tries; | |
40 | |
41 ngx_event_get_peer_pt get; | |
42 ngx_event_free_peer_pt free; | |
43 void *data; | |
44 | |
45 #if (NGX_SSL) | |
46 ngx_ssl_session_t *ssl_session; | |
47 ngx_event_save_peer_pt save_session; | |
24 #endif | 48 #endif |
25 | 49 |
26 int rcvbuf; | 50 #if (NGX_THREADS) |
51 ngx_atomic_t *lock; | |
52 #endif | |
27 | 53 |
28 ngx_log_t *log; | 54 int rcvbuf; |
29 | 55 |
30 unsigned cached:1; | 56 ngx_log_t *log; |
31 unsigned log_error:2; /* ngx_connection_log_error_e */ | 57 |
32 } ngx_peer_connection_t; | 58 unsigned cached:1; |
59 unsigned log_error:2; /* ngx_connection_log_error_e */ | |
60 }; | |
33 | 61 |
34 | 62 |
35 ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc); | 63 ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc); |
36 void ngx_event_connect_peer_failed(ngx_peer_connection_t *pc, ngx_uint_t down); | 64 ngx_int_t ngx_event_get_peer(ngx_peer_connection_t *pc, void *data); |
65 | |
37 | 66 |
38 | 67 |
39 #endif /* _NGX_EVENT_CONNECT_H_INCLUDED_ */ | 68 #endif /* _NGX_EVENT_CONNECT_H_INCLUDED_ */ |