Skip to content
This repository
Browse code

Relocates some internal information structures (structural clean up).

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6735 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
commit 9a67d8716f637981a5037c9c2c922d1d415dabd7 1 parent 088e4eb
Alvaro Lopez Ortega alobbs authored
27 cherokee/config_entry.c
@@ -46,8 +46,8 @@ CHEROKEE_ADD_FUNC_NEW (config_entry);
46 46 CHEROKEE_ADD_FUNC_FREE (config_entry);
47 47
48 48
49   -ret_t
50   -cherokee_config_entry_init (cherokee_config_entry_t *entry)
  49 +static ret_t
  50 +init (struct cherokee_config_entry *entry)
51 51 {
52 52 entry->handler_new_func = NULL;
53 53 entry->handler_properties = NULL;
@@ -85,6 +85,13 @@ cherokee_config_entry_init (cherokee_config_entry_t *entry)
85 85
86 86
87 87 ret_t
  88 +cherokee_config_entry_init (cherokee_config_entry_t *entry)
  89 +{
  90 + return init (entry);
  91 +}
  92 +
  93 +
  94 +ret_t
88 95 cherokee_config_entry_mrproper (cherokee_config_entry_t *entry)
89 96 {
90 97 cherokee_list_t *i, *tmp;
@@ -304,3 +311,19 @@ cherokee_config_entry_print (cherokee_config_entry_t *entry)
304 311
305 312 return ret_ok;
306 313 }
  314 +
  315 +
  316 +/* Entry reference
  317 + */
  318 +
  319 +ret_t
  320 +cherokee_config_entry_ref_init (cherokee_config_entry_ref_t *entry)
  321 +{
  322 + return init (entry);
  323 +}
  324 +
  325 +ret_t
  326 +cherokee_config_entry_ref_clean (cherokee_config_entry_ref_t *entry)
  327 +{
  328 + return init (entry);
  329 +}
15 cherokee/config_entry.h
@@ -69,7 +69,7 @@ typedef enum {
69 69 } cherokee_expiration_props_t;
70 70
71 71
72   -typedef struct {
  72 +struct cherokee_config_entry {
73 73 /* Properties
74 74 */
75 75 cherokee_buffer_t *document_root;
@@ -117,11 +117,15 @@ typedef struct {
117 117 */
118 118 cherokee_null_int_t timeout_lapse;
119 119 cherokee_buffer_t *timeout_header;
120   -} cherokee_config_entry_t;
  120 +};
121 121
122   -#define CONF_ENTRY(x) ((cherokee_config_entry_t *)(x))
  122 +typedef struct cherokee_config_entry cherokee_config_entry_t;
  123 +typedef struct cherokee_config_entry cherokee_config_entry_ref_t;
123 124
  125 +#define CONF_ENTRY(x) ((cherokee_config_entry_t *)(x))
124 126
  127 +/* Entry
  128 + */
125 129 ret_t cherokee_config_entry_new (cherokee_config_entry_t **entry);
126 130 ret_t cherokee_config_entry_free (cherokee_config_entry_t *entry);
127 131 ret_t cherokee_config_entry_init (cherokee_config_entry_t *entry);
@@ -140,4 +144,9 @@ ret_t cherokee_config_entry_complete (cherokee_config_entry_t *entry,
140 144
141 145 ret_t cherokee_config_entry_print (cherokee_config_entry_t *entry);
142 146
  147 +/* Entry Reference
  148 + */
  149 +ret_t cherokee_config_entry_ref_init (cherokee_config_entry_ref_t *entry);
  150 +ret_t cherokee_config_entry_ref_clean (cherokee_config_entry_ref_t *entry);
  151 +
143 152 #endif /* CHEROKEE_CONFIG_ENTRY_H */
8 cherokee/connection-protected.h
@@ -67,6 +67,7 @@
67 67 #include "regex.h"
68 68 #include "bind.h"
69 69 #include "bogotime.h"
  70 +#include "config_entry.h"
70 71
71 72 typedef enum {
72 73 phase_nothing,
@@ -104,6 +105,7 @@ struct cherokee_connection {
104 105 void *vserver;
105 106 void *thread;
106 107 cherokee_bind_t *bind;
  108 + cherokee_config_entry_ref_t config_entry;
107 109
108 110 /* ID
109 111 */
@@ -137,7 +139,6 @@ struct cherokee_connection {
137 139 /* Headers
138 140 */
139 141 cherokee_header_t header;
140   - cherokee_list_t *header_ops;
141 142
142 143 /* Encoders
143 144 */
@@ -166,8 +167,6 @@ struct cherokee_connection {
166 167 /* Authentication
167 168 */
168 169 cherokee_validator_t *validator; /* Validator object */
169   - cherokee_buffer_t *realm_ref; /* "My private data" */
170   -
171 170 cherokee_http_auth_t auth_type; /* Auth type of the resource */
172 171 cherokee_http_auth_t req_auth_type; /* Auth type of the request */
173 172
@@ -187,7 +186,6 @@ struct cherokee_connection {
187 186 */
188 187 uint32_t keepalive;
189 188 time_t timeout;
190   -
191 189 time_t timeout_lapse;
192 190 cherokee_buffer_t *timeout_header;
193 191
@@ -207,8 +205,6 @@ struct cherokee_connection {
207 205 /* Front-line cache
208 206 */
209 207 cherokee_flcache_conn_t flcache;
210   - cherokee_flcache_policy_t flcache_policy;
211   - cherokee_list_t *flcache_cookies_disregard;
212 208
213 209 /* Regular expressions
214 210 */
95 cherokee/connection.c
@@ -107,7 +107,6 @@ cherokee_connection_new (cherokee_connection_t **conn)
107 107 n->range_end = -1;
108 108 n->vserver = NULL;
109 109 n->arguments = NULL;
110   - n->realm_ref = NULL;
111 110 n->mmaped = NULL;
112 111 n->mmaped_len = 0;
113 112 n->io_entry_ref = NULL;
@@ -131,9 +130,6 @@ cherokee_connection_new (cherokee_connection_t **conn)
131 130 n->limit_rate = false;
132 131 n->limit_bps = 0;
133 132 n->limit_blocked_until = 0;
134   - n->header_ops = NULL;
135   - n->flcache_cookies_disregard = NULL;
136   - n->flcache_policy = flcache_policy_explicitly_allowed;
137 133
138 134 cherokee_buffer_init (&n->buffer);
139 135 cherokee_buffer_init (&n->header_buffer);
@@ -174,6 +170,7 @@ cherokee_connection_new (cherokee_connection_t **conn)
174 170 n->chunked_last_package = false;
175 171 cherokee_buffer_init (&n->chunked_len);
176 172
  173 + cherokee_config_entry_ref_init (&n->config_entry);
177 174 cherokee_flcache_conn_init (&n->flcache);
178 175
179 176 *conn = n;
@@ -302,38 +299,34 @@ cherokee_connection_clean (cherokee_connection_t *conn)
302 299 conn->validator = NULL;
303 300 }
304 301
305   - conn->phase = phase_reading_header;
306   - conn->auth_type = http_auth_nothing;
307   - conn->req_auth_type = http_auth_nothing;
308   - conn->upgrade = http_upgrade_nothing;
309   - conn->options = conn_op_nothing;
310   - conn->error_code = http_ok;
311   - conn->range_start = -1;
312   - conn->range_end = -1;
313   - conn->logger_ref = NULL;
314   - conn->realm_ref = NULL;
315   - conn->mmaped = NULL;
316   - conn->mmaped_len = 0;
317   - conn->rx = 0;
318   - conn->tx = 0;
319   - conn->rx_partial = 0;
320   - conn->tx_partial = 0;
321   - conn->traffic_next = 0;
322   - conn->polling_multiple = false;
323   - conn->polling_mode = FDPOLL_MODE_NONE;
324   - conn->expiration = cherokee_expiration_none;
325   - conn->expiration_time = 0;
326   - conn->expiration_prop = cherokee_expiration_prop_none;
327   - conn->chunked_encoding = false;
328   - conn->chunked_sent = 0;
329   - conn->chunked_last_package = false;
330   - conn->respins = 0;
331   - conn->limit_rate = false;
332   - conn->limit_bps = 0;
333   - conn->limit_blocked_until = 0;
334   - conn->header_ops = NULL;
335   - conn->flcache_cookies_disregard = NULL;
336   - conn->flcache_policy = flcache_policy_explicitly_allowed;
  302 + conn->phase = phase_reading_header;
  303 + conn->auth_type = http_auth_nothing;
  304 + conn->req_auth_type = http_auth_nothing;
  305 + conn->upgrade = http_upgrade_nothing;
  306 + conn->options = conn_op_nothing;
  307 + conn->error_code = http_ok;
  308 + conn->range_start = -1;
  309 + conn->range_end = -1;
  310 + conn->logger_ref = NULL;
  311 + conn->mmaped = NULL;
  312 + conn->mmaped_len = 0;
  313 + conn->rx = 0;
  314 + conn->tx = 0;
  315 + conn->rx_partial = 0;
  316 + conn->tx_partial = 0;
  317 + conn->traffic_next = 0;
  318 + conn->polling_multiple = false;
  319 + conn->polling_mode = FDPOLL_MODE_NONE;
  320 + conn->expiration = cherokee_expiration_none;
  321 + conn->expiration_time = 0;
  322 + conn->expiration_prop = cherokee_expiration_prop_none;
  323 + conn->chunked_encoding = false;
  324 + conn->chunked_sent = 0;
  325 + conn->chunked_last_package = false;
  326 + conn->respins = 0;
  327 + conn->limit_rate = false;
  328 + conn->limit_bps = 0;
  329 + conn->limit_blocked_until = 0;
337 330
338 331 memset (conn->regex_ovector, 0, OVECTOR_LEN * sizeof(int));
339 332 conn->regex_ovecsize = 0;
@@ -364,6 +357,8 @@ cherokee_connection_clean (cherokee_connection_t *conn)
364 357 cherokee_buffer_clean (&conn->error_internal_url);
365 358 cherokee_buffer_clean (&conn->error_internal_qs);
366 359
  360 + cherokee_config_entry_ref_clean (&conn->config_entry);
  361 +
367 362 if (conn->arguments != NULL) {
368 363 cherokee_avl_free (conn->arguments,
369 364 (cherokee_func_free_t) cherokee_buffer_free);
@@ -570,7 +565,7 @@ build_response_header_authentication (cherokee_connection_t *conn, cherokee_buff
570 565 */
571 566 if (conn->auth_type & http_auth_basic) {
572 567 cherokee_buffer_add_str (buffer, "WWW-Authenticate: Basic realm=\"");
573   - cherokee_buffer_add_buffer (buffer, conn->realm_ref);
  568 + cherokee_buffer_add_buffer (buffer, conn->config_entry.auth_realm);
574 569 cherokee_buffer_add_str (buffer, "\""CRLF);
575 570 }
576 571
@@ -585,7 +580,7 @@ build_response_header_authentication (cherokee_connection_t *conn, cherokee_buff
585 580 /* Realm
586 581 */
587 582 cherokee_buffer_add_str (buffer, "WWW-Authenticate: Digest realm=\"");
588   - cherokee_buffer_add_buffer (buffer, conn->realm_ref);
  583 + cherokee_buffer_add_buffer (buffer, conn->config_entry.auth_realm);
589 584 cherokee_buffer_add_str (buffer, "\", ");
590 585
591 586 /* Nonce:
@@ -809,7 +804,7 @@ build_response_header (cherokee_connection_t *conn,
809 804
810 805 /* Authentication
811 806 */
812   - if (conn->realm_ref != NULL) {
  807 + if (conn->config_entry.auth_realm != NULL) {
813 808 if ((conn->error_code == http_unauthorized) ||
814 809 (conn->error_internal_code == http_unauthorized))
815 810 {
@@ -867,8 +862,8 @@ build_response_header_final (cherokee_connection_t *conn,
867 862 /* Headers ops:
868 863 * This must be the last operation
869 864 */
870   - if (conn->header_ops) {
871   - cherokee_header_op_render (conn->header_ops, &conn->buffer);
  865 + if (conn->config_entry.header_ops) {
  866 + cherokee_header_op_render (conn->config_entry.header_ops, &conn->buffer);
872 867 }
873 868 }
874 869
@@ -1824,8 +1819,6 @@ ret_t
1824 1819 cherokee_connection_set_custom_droot (cherokee_connection_t *conn,
1825 1820 cherokee_config_entry_t *entry)
1826 1821 {
1827   - ret_t ret;
1828   -
1829 1822 /* Shortcut
1830 1823 */
1831 1824 if ((entry->document_root == NULL) ||
@@ -1837,7 +1830,7 @@ cherokee_connection_set_custom_droot (cherokee_connection_t *conn,
1837 1830 BIT_SET (conn->options, conn_op_document_root);
1838 1831
1839 1832 cherokee_buffer_clean (&conn->local_directory);
1840   - ret = cherokee_buffer_add_buffer (&conn->local_directory, entry->document_root);
  1833 + cherokee_buffer_add_buffer (&conn->local_directory, entry->document_root);
1841 1834
1842 1835 /* It has to drop the webdir from the request:
1843 1836 *
@@ -2348,6 +2341,20 @@ cherokee_connection_create_handler (cherokee_connection_t *conn, cherokee_config
2348 2341 case ret_ok:
2349 2342 case ret_eof:
2350 2343 case ret_eagain:
  2344 + /* Trace the name of the new handler
  2345 + */
  2346 +#ifdef TRACE_ENABLED
  2347 + if ((conn->handler != NULL) &&
  2348 + (cherokee_trace_is_tracing()))
  2349 + {
  2350 + char *name = NULL;
  2351 +
  2352 + ret = cherokee_module_get_name (MODULE (conn->handler), &name);
  2353 + if ((ret == ret_ok) && (name != NULL)) {
  2354 + TRACE(ENTRIES",handler", "Instanced handler: '%s'\n", name);
  2355 + }
  2356 + }
  2357 +#endif
2351 2358 return ret;
2352 2359 default:
2353 2360 if ((conn->handler == NULL) &&
6 cherokee/flcache.c
@@ -525,13 +525,13 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
525 525 /* Set-cookie
526 526 */
527 527 else if (strncasecmp (begin, "Set-cookie:", 11) == 0) {
528   - if (conn->flcache_cookies_disregard) {
  528 + if (conn->config_entry.flcache_cookies_disregard) {
529 529 int re;
530 530 void *pcre;
531 531 cherokee_list_t *i;
532 532 cherokee_boolean_t matched = false;
533 533
534   - list_for_each (i, conn->flcache_cookies_disregard) {
  534 + list_for_each (i, conn->config_entry.flcache_cookies_disregard) {
535 535 pcre = LIST_ITEM_INFO(i);
536 536
537 537 re = pcre_exec (pcre, NULL, begin, end-begin, 0, 0, NULL, 0);
@@ -600,7 +600,7 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
600 600 /* Check the caching policy
601 601 */
602 602 if ((! do_cache) &&
603   - (conn->flcache_policy == flcache_policy_explicitly_allowed))
  603 + (conn->config_entry.flcache_policy == flcache_policy_explicitly_allowed))
604 604 {
605 605 TRACE(ENTRIES, "Doesn't explicitly allow caching.%s", "\n");
606 606 return ret_deny;
17 cherokee/rule_list.c
@@ -64,8 +64,6 @@ static void
64 64 update_connection (cherokee_connection_t *conn,
65 65 cherokee_config_entry_t *ret_config)
66 66 {
67   - if (! conn->realm_ref)
68   - conn->realm_ref = ret_config->auth_realm;
69 67 if (! conn->auth_type)
70 68 conn->auth_type = ret_config->authentication;
71 69
@@ -76,6 +74,11 @@ update_connection (cherokee_connection_t *conn,
76 74 conn->expiration_time = ret_config->expiration_time;
77 75 conn->expiration_prop = ret_config->expiration_prop;
78 76 }
  77 +
  78 + if (! NULLI_IS_NULL(ret_config->timeout_lapse)) {
  79 + conn->timeout_lapse = ret_config->timeout_lapse;
  80 + conn->timeout_header = ret_config->timeout_header;
  81 + }
79 82 }
80 83
81 84 ret_t
@@ -111,15 +114,9 @@ cherokee_rule_list_match (cherokee_rule_list_t *list,
111 114 TRACE(ENTRIES, "Merging rule prio=%d\n", rule->priority);
112 115 cherokee_config_entry_complete (ret_config, &rule->config);
113 116
114   - /* Update the connection
115   - */
116   - update_connection (conn, ret_config);
117   -
118 117 /* Should it continue? */
119 118 if (rule->final) {
120   - TRACE(ENTRIES, "Final rule prio=%d. Exiting.\n",
121   - rule->priority);
122   - return ret_ok;
  119 + goto out;
123 120 }
124 121 }
125 122
@@ -128,10 +125,10 @@ cherokee_rule_list_match (cherokee_rule_list_t *list,
128 125 list->def_rule->match(list->def_rule, conn, ret_config);
129 126 cherokee_config_entry_complete (ret_config, &list->def_rule->config);
130 127
  128 +out:
131 129 /* Update the connection
132 130 */
133 131 update_connection (conn, ret_config);
134   -
135 132 return ret_ok;
136 133 }
137 134
64 cherokee/thread.c
@@ -950,9 +950,8 @@ process_active_connections (cherokee_thread_t *thd)
950 950 /* fall down */
951 951
952 952 case phase_setup_connection: {
953   - cherokee_config_entry_t entry;
954   - cherokee_rule_list_t *rules;
955   - cherokee_boolean_t is_userdir;
  953 + cherokee_rule_list_t *rules;
  954 + cherokee_boolean_t is_userdir;
956 955
957 956 /* Turn the connection in write mode
958 957 */
@@ -980,7 +979,7 @@ process_active_connections (cherokee_thread_t *thd)
980 979 /* Set Keepalive, Rate, and skip to add_headers
981 980 */
982 981 cherokee_connection_set_keepalive (conn);
983   - cherokee_connection_set_rate (conn, &entry);
  982 + cherokee_connection_set_rate (conn, &conn->config_entry);
984 983
985 984 conn->phase = phase_add_headers;
986 985 goto add_headers;
@@ -990,7 +989,7 @@ process_active_connections (cherokee_thread_t *thd)
990 989 TRACE (ENTRIES, "Setup connection begins: request=\"%s\"\n", conn->request.buf);
991 990 TRACE_CONN(conn);
992 991
993   - cherokee_config_entry_init (&entry);
  992 + cherokee_config_entry_ref_clean (&conn->config_entry);
994 993
995 994 /* Choose the virtual entries table
996 995 */
@@ -1011,9 +1010,12 @@ process_active_connections (cherokee_thread_t *thd)
1011 1010 ret = cherokee_connection_build_local_directory (conn, CONN_VSRV(conn));
1012 1011 }
1013 1012
1014   - /* Check against the rule list
  1013 + /* Check against the rule list. It fills out ->config_entry, and
  1014 + * conn->auth_type
  1015 + * conn->expiration*
  1016 + * conn->timeout_*
1015 1017 */
1016   - ret = cherokee_rule_list_match (rules, conn, &entry);
  1018 + ret = cherokee_rule_list_match (rules, conn, &conn->config_entry);
1017 1019 if (unlikely (ret != ret_ok)) {
1018 1020 cherokee_connection_setup_error_handler (conn);
1019 1021 continue;
@@ -1021,17 +1023,17 @@ process_active_connections (cherokee_thread_t *thd)
1021 1023
1022 1024 /* Local directory
1023 1025 */
1024   - cherokee_connection_set_custom_droot (conn, &entry);
  1026 + cherokee_connection_set_custom_droot (conn, &conn->config_entry);
1025 1027
1026 1028 /* Set the logger of the connection
1027 1029 */
1028   - if (entry.no_log != true) {
  1030 + if (conn->config_entry.no_log != true) {
1029 1031 conn->logger_ref = CONN_VSRV(conn)->logger;
1030 1032 }
1031 1033
1032 1034 /* Check of the HTTP method is supported by the handler
1033 1035 */
1034   - ret = cherokee_connection_check_http_method (conn, &entry);
  1036 + ret = cherokee_connection_check_http_method (conn, &conn->config_entry);
1035 1037 if (unlikely (ret != ret_ok)) {
1036 1038 cherokee_connection_setup_error_handler (conn);
1037 1039 continue;
@@ -1039,7 +1041,7 @@ process_active_connections (cherokee_thread_t *thd)
1039 1041
1040 1042 /* Check Only-Secure connections
1041 1043 */
1042   - ret = cherokee_connection_check_only_secure (conn, &entry);
  1044 + ret = cherokee_connection_check_only_secure (conn, &conn->config_entry);
1043 1045 if (unlikely (ret != ret_ok)) {
1044 1046 cherokee_connection_setup_error_handler (conn);
1045 1047 continue;
@@ -1047,7 +1049,7 @@ process_active_connections (cherokee_thread_t *thd)
1047 1049
1048 1050 /* Check for IP validation
1049 1051 */
1050   - ret = cherokee_connection_check_ip_validation (conn, &entry);
  1052 + ret = cherokee_connection_check_ip_validation (conn, &conn->config_entry);
1051 1053 if (unlikely (ret != ret_ok)) {
1052 1054 cherokee_connection_setup_error_handler (conn);
1053 1055 continue;
@@ -1055,7 +1057,7 @@ process_active_connections (cherokee_thread_t *thd)
1055 1057
1056 1058 /* Check for authentication
1057 1059 */
1058   - ret = cherokee_connection_check_authentication (conn, &entry);
  1060 + ret = cherokee_connection_check_authentication (conn, &conn->config_entry);
1059 1061 if (unlikely (ret != ret_ok)) {
1060 1062 cherokee_connection_setup_error_handler (conn);
1061 1063 continue;
@@ -1067,27 +1069,11 @@ process_active_connections (cherokee_thread_t *thd)
1067 1069
1068 1070 /* Traffic Shaping
1069 1071 */
1070   - cherokee_connection_set_rate (conn, &entry);
1071   -
1072   - /* Custom timeout
1073   - */
1074   - if (! NULLI_IS_NULL(entry.timeout_lapse)) {
1075   - conn->timeout_lapse = entry.timeout_lapse;
1076   - conn->timeout_header = entry.timeout_header;
1077   - }
1078   -
1079   - if (entry.header_ops) {
1080   - conn->header_ops = entry.header_ops;
1081   - }
1082   -
1083   - if (NULLB_TO_BOOL(entry.flcache)) {
1084   - conn->flcache_policy = entry.flcache_policy;
1085   - conn->flcache_cookies_disregard = entry.flcache_cookies_disregard;
1086   - }
  1072 + cherokee_connection_set_rate (conn, &conn->config_entry);
1087 1073
1088 1074 /* Create the handler
1089 1075 */
1090   - ret = cherokee_connection_create_handler (conn, &entry);
  1076 + ret = cherokee_connection_create_handler (conn, &conn->config_entry);
1091 1077 switch (ret) {
1092 1078 case ret_ok:
1093 1079 break;
@@ -1109,7 +1095,7 @@ process_active_connections (cherokee_thread_t *thd)
1109 1095
1110 1096 /* Instance an encoder if needed
1111 1097 */
1112   - ret = cherokee_connection_create_encoder (conn, entry.encoders);
  1098 + ret = cherokee_connection_create_encoder (conn, conn->config_entry.encoders);
1113 1099 if (unlikely (ret != ret_ok)) {
1114 1100 cherokee_connection_setup_error_handler (conn);
1115 1101 continue;
@@ -1125,8 +1111,8 @@ process_active_connections (cherokee_thread_t *thd)
1125 1111
1126 1112 /* Front-line cache
1127 1113 */
1128   - if ((entry.flcache == true) &&
1129   - (CONN_VSRV(conn)->flcache != NULL) &&
  1114 + if ((CONN_VSRV(conn)->flcache != NULL) &&
  1115 + (conn->config_entry.flcache == true) &&
1130 1116 (cherokee_flcache_req_is_storable (CONN_VSRV(conn)->flcache, conn) == ret_ok))
1131 1117 {
1132 1118 cherokee_flcache_req_set_store (CONN_VSRV(conn)->flcache, conn);
@@ -1134,19 +1120,15 @@ process_active_connections (cherokee_thread_t *thd)
1134 1120 /* Update expiration
1135 1121 */
1136 1122 if (conn->flcache.mode == flcache_mode_in) {
1137   - if (entry.expiration == cherokee_expiration_epoch) {
  1123 + if (conn->config_entry.expiration == cherokee_expiration_epoch) {
1138 1124 conn->flcache.avl_node_ref->valid_until = 0;
1139   - } else if (entry.expiration == cherokee_expiration_time) {
1140   - conn->flcache.avl_node_ref->valid_until = cherokee_bogonow_now + entry.expiration_time;
  1125 + } else if (conn->config_entry.expiration == cherokee_expiration_time) {
  1126 + conn->flcache.avl_node_ref->valid_until = cherokee_bogonow_now + conn->config_entry.expiration_time;
1141 1127 }
1142 1128 }
1143 1129 }
1144 1130
1145 1131 conn->phase = phase_init;
1146   -
1147   - /* There isn't need of free entry, it is in the stack and the
1148   - * buffers inside it are just references..
1149   - */
1150 1132 }
1151 1133
1152 1134 case phase_init:
2  cherokee/validator_htdigest.c
@@ -97,7 +97,7 @@ cherokee_validator_htdigest_free (cherokee_validator_htdigest_t *htdigest)
97 97 static ret_t
98 98 build_HA1 (cherokee_connection_t *conn, cherokee_buffer_t *buf)
99 99 {
100   - cherokee_buffer_add_va (buf, "%s:%s:%s", conn->validator->user.buf, conn->realm_ref->buf, conn->validator->passwd.buf);
  100 + cherokee_buffer_add_va (buf, "%s:%s:%s", conn->validator->user.buf, conn->config_entry.auth_realm->buf, conn->validator->passwd.buf);
101 101 cherokee_buffer_encode_md5_digest (buf);
102 102 return ret_ok;
103 103 }

0 comments on commit 9a67d87

Please sign in to comment.
Something went wrong with that request. Please try again.