comparison src/event/ngx_event_connect.h @ 136:da00cde00e8a

nginx-0.0.1-2003-10-02-09:39:37 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 02 Oct 2003 05:39:37 +0000
parents 842a78cebbb7
children 8dee38ea9117
comparison
equal deleted inserted replaced
135:e29909bd9b8a 136:da00cde00e8a
3 3
4 4
5 #include <ngx_config.h> 5 #include <ngx_config.h>
6 #include <ngx_core.h> 6 #include <ngx_core.h>
7 #include <ngx_event.h> 7 #include <ngx_event.h>
8
9
10 #define NGX_CONNECT_ERROR -10
8 11
9 12
10 typedef struct { 13 typedef struct {
11 u_int32_t addr; 14 u_int32_t addr;
12 ngx_str_t host; 15 ngx_str_t host;
17 time_t accessed; 20 time_t accessed;
18 } ngx_peer_t; 21 } ngx_peer_t;
19 22
20 23
21 typedef struct { 24 typedef struct {
22 int current; 25 int current;
23 int number; 26 int number;
24 int max_fails; 27 int max_fails;
25 int fail_timeout; 28 int fail_timeout;
29 int last_cached;
26 30
27 /* ngx_mutex_t *mutex; */ 31 /* ngx_mutex_t *mutex; */
28 ngx_connection_t *cached; 32 ngx_connection_t **cached;
29 33
30 ngx_peer_t peers[1]; 34 ngx_peer_t peers[1];
31 } ngx_peers_t; 35 } ngx_peers_t;
32 36
33 37
34 typedef struct { 38 typedef struct {
35 ngx_peers_t *peers; 39 ngx_peers_t *peers;
44 48
45 unsigned cached:1; 49 unsigned cached:1;
46 } ngx_peer_connection_t; 50 } ngx_peer_connection_t;
47 51
48 52
53 int ngx_event_connect_peer(ngx_peer_connection_t *pc);
54 void ngx_event_connect_peer_failed(ngx_peer_connection_t *pc);
55
56
49 #endif /* _NGX_EVENT_CONNECT_H_INCLUDED_ */ 57 #endif /* _NGX_EVENT_CONNECT_H_INCLUDED_ */