Mercurial > hg > nginx
comparison src/event/ngx_event_connect.h @ 1346:175edf225f10 stable-0.5
r1285 merge:
fix segfault when session was freed twice
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 29 Jul 2007 17:25:06 +0000 |
parents | 4d68c486fcb0 |
children | ebcee0063cd8 |
comparison
equal
deleted
inserted
replaced
1345:f4b81f7331d1 | 1346:175edf225f10 |
---|---|
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 #define NGX_PEER_KEEPALIVE 1 | 16 #define NGX_PEER_KEEPALIVE 1 |
17 #define NGX_PEER_NEXT 2 | 17 #define NGX_PEER_NEXT 2 |
18 #define NGX_PEER_FAILED 4 | 18 #define NGX_PEER_FAILED 4 |
19 | 19 |
20 | 20 |
21 typedef struct ngx_peer_connection_s ngx_peer_connection_t; | 21 typedef struct ngx_peer_connection_s ngx_peer_connection_t; |
22 | 22 |
23 typedef ngx_int_t (*ngx_event_get_peer_pt)(ngx_peer_connection_t *pc, | 23 typedef ngx_int_t (*ngx_event_get_peer_pt)(ngx_peer_connection_t *pc, |
24 void *data); | 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, | 25 typedef void (*ngx_event_free_peer_pt)(ngx_peer_connection_t *pc, void *data, |
29 ngx_uint_t state); | 26 ngx_uint_t state); |
27 #if (NGX_SSL) | |
28 | |
29 typedef ngx_int_t (*ngx_event_set_peer_session_pt)(ngx_peer_connection_t *pc, | |
30 void *data); | |
31 typedef void (*ngx_event_save_peer_session_pt)(ngx_peer_connection_t *pc, | |
32 void *data); | |
33 #endif | |
30 | 34 |
31 | 35 |
32 struct ngx_peer_connection_s { | 36 struct ngx_peer_connection_s { |
33 ngx_connection_t *connection; | 37 ngx_connection_t *connection; |
34 | 38 |
35 struct sockaddr *sockaddr; | 39 struct sockaddr *sockaddr; |
36 socklen_t socklen; | 40 socklen_t socklen; |
37 ngx_str_t *name; | 41 ngx_str_t *name; |
38 | 42 |
39 ngx_uint_t tries; | 43 ngx_uint_t tries; |
40 | 44 |
41 ngx_event_get_peer_pt get; | 45 ngx_event_get_peer_pt get; |
42 ngx_event_free_peer_pt free; | 46 ngx_event_free_peer_pt free; |
43 void *data; | 47 void *data; |
44 | 48 |
45 #if (NGX_SSL) | 49 #if (NGX_SSL) |
46 ngx_ssl_session_t *ssl_session; | 50 ngx_event_set_peer_session_pt set_session; |
47 ngx_event_save_peer_pt save_session; | 51 ngx_event_save_peer_session_pt save_session; |
48 #endif | 52 #endif |
49 | 53 |
50 #if (NGX_THREADS) | 54 #if (NGX_THREADS) |
51 ngx_atomic_t *lock; | 55 ngx_atomic_t *lock; |
52 #endif | 56 #endif |
53 | 57 |
54 int rcvbuf; | 58 int rcvbuf; |
55 | 59 |
56 ngx_log_t *log; | 60 ngx_log_t *log; |
57 | 61 |
58 unsigned cached:1; | 62 unsigned cached:1; |
59 unsigned log_error:2; /* ngx_connection_log_error_e */ | 63 |
64 /* ngx_connection_log_error_e */ | |
65 unsigned log_error:2; | |
60 }; | 66 }; |
61 | 67 |
62 | 68 |
63 ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc); | 69 ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc); |
64 ngx_int_t ngx_event_get_peer(ngx_peer_connection_t *pc, void *data); | 70 ngx_int_t ngx_event_get_peer(ngx_peer_connection_t *pc, void *data); |