Mercurial > hg > nginx-quic
comparison src/event/ngx_event_openssl.h @ 1014:5ffd76a9ccf3
optimize the SSL session cache allocations
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 11 Jan 2007 17:39:02 +0000 |
parents | 8dfb3aa75de2 |
children | ee25c79bea34 |
comparison
equal
deleted
inserted
replaced
1013:7dd987e09701 | 1014:5ffd76a9ccf3 |
---|---|
53 | 53 |
54 #define NGX_SSL_DFLT_BUILTIN_SCACHE -2 | 54 #define NGX_SSL_DFLT_BUILTIN_SCACHE -2 |
55 #define NGX_SSL_NO_BUILTIN_SCACHE -3 | 55 #define NGX_SSL_NO_BUILTIN_SCACHE -3 |
56 | 56 |
57 | 57 |
58 typedef struct ngx_ssl_cached_sess_s ngx_ssl_cached_sess_t; | 58 #define NGX_SSL_MAX_SESSION_SIZE (4096) |
59 | 59 |
60 typedef struct ngx_ssl_sess_id_s ngx_ssl_sess_id_t; | |
60 | 61 |
61 #define NGX_SSL_MAX_SESSION_SIZE (4096 - offsetof(ngx_ssl_cached_sess_t, asn1)) | 62 struct ngx_ssl_sess_id_s { |
62 | |
63 | |
64 typedef struct { | |
65 ngx_rbtree_node_t node; | 63 ngx_rbtree_node_t node; |
66 u_char *id; | 64 u_char *id; |
67 size_t len; | 65 size_t len; |
68 ngx_ssl_cached_sess_t *session; | 66 u_char *session; |
69 } ngx_ssl_sess_id_t; | 67 ngx_ssl_sess_id_t *prev; |
70 | 68 ngx_ssl_sess_id_t *next; |
71 | |
72 struct ngx_ssl_cached_sess_s { | |
73 ngx_ssl_cached_sess_t *prev; | |
74 ngx_ssl_cached_sess_t *next; | |
75 time_t expire; | 69 time_t expire; |
76 ngx_ssl_sess_id_t *sess_id; | |
77 u_char asn1[1]; | |
78 }; | 70 }; |
79 | 71 |
80 | 72 |
81 typedef struct { | 73 typedef struct { |
82 ngx_rbtree_t *session_rbtree; | 74 ngx_rbtree_t *session_rbtree; |
83 ngx_ssl_cached_sess_t session_cache_head; | 75 ngx_ssl_sess_id_t session_cache_head; |
84 ngx_ssl_cached_sess_t session_cache_tail; | 76 ngx_ssl_sess_id_t session_cache_tail; |
85 } ngx_ssl_session_cache_t; | 77 } ngx_ssl_session_cache_t; |
86 | 78 |
87 | 79 |
88 | 80 |
89 #define NGX_SSL_SSLv2 2 | 81 #define NGX_SSL_SSLv2 2 |