Skip to content
This repository
Browse code

Renames a whole lot of 'conn' variables to 'req'. The target is to

clean the namespace a little bit, so the actual work of implementing
the new classes can be started safely.
  • Loading branch information...
commit eac0a2c6d1f48f9a0ce7733cbe59a21ab93b24bf 1 parent 1caa31e
Alvaro Lopez Ortega authored

Showing 46 changed files with 2,269 additions and 2,266 deletions. Show diff stats Hide diff stats

  1. 72  cherokee/avl_flcache.c
  2. 2  cherokee/avl_flcache.h
  3. 8  cherokee/balancer.c
  4. 8  cherokee/balancer_failover.c
  5. 8  cherokee/balancer_ip_hash.c
  6. 8  cherokee/balancer_round_robin.c
  7. 2  cherokee/cherokee.h
  8. 4  cherokee/cryptor.c
  9. 4  cherokee/cryptor.h
  10. 36  cherokee/cryptor_libssl.c
  11. 6  cherokee/encoder.c
  12. 8  cherokee/encoder.h
  13. 4  cherokee/encoder_deflate.c
  14. 2  cherokee/encoder_deflate.h
  15. 8  cherokee/encoder_gzip.c
  16. 2  cherokee/encoder_gzip.h
  17. 144  cherokee/flcache.c
  18. 56  cherokee/gen_evhost.c
  19. 46  cherokee/handler_admin.c
  20. 74  cherokee/handler_cgi.c
  21. 281  cherokee/handler_cgi_base.c
  22. 94  cherokee/handler_common.c
  23. 40  cherokee/handler_dbslayer.c
  24. 62  cherokee/handler_dirlist.c
  25. 55  cherokee/handler_error.c
  26. 40  cherokee/handler_error_nn.c
  27. 48  cherokee/handler_error_redir.c
  28. 78  cherokee/handler_fcgi.c
  29. 207  cherokee/handler_file.c
  30. 28  cherokee/handler_post_report.c
  31. 242  cherokee/handler_proxy.c
  32. 140  cherokee/handler_redir.c
  33. 68  cherokee/handler_render_rrd.c
  34. 60  cherokee/handler_scgi.c
  35. 54  cherokee/handler_secdownload.c
  36. 12  cherokee/handler_server_info.c
  37. 40  cherokee/handler_ssi.c
  38. 62  cherokee/handler_streaming.c
  39. 50  cherokee/handler_uwsgi.c
  40. 16  cherokee/logger.c
  41. 4  cherokee/logger.h
  42. 142  cherokee/logger_custom.c
  43. 4  cherokee/nonce.c
  44. 92  cherokee/post.c
  45. 1,506  cherokee/request.c
  46. 608  cherokee/thread.c
72  cherokee/avl_flcache.c
@@ -34,23 +34,23 @@
34 34
 
35 35
 
36 36
 static ret_t
37  
-conn_to_node (cherokee_request_t       *conn,
38  
-	      cherokee_avl_flcache_node_t *node)
  37
+req_to_node (cherokee_request_t          *req,
  38
+	     cherokee_avl_flcache_node_t *node)
39 39
 {
40 40
 	cherokee_avl_generic_node_init (AVL_GENERIC_NODE(node));
41 41
 
42 42
 	/* Request */
43 43
 	cherokee_buffer_init (&node->request);
44 44
 
45  
-	if (conn->request_original.len > 0) {
46  
-		cherokee_buffer_add_buffer (&node->request, &conn->request_original);
  45
+	if (req->request_original.len > 0) {
  46
+		cherokee_buffer_add_buffer (&node->request, &req->request_original);
47 47
 	} else {
48  
-		cherokee_buffer_add_buffer (&node->request, &conn->request);
  48
+		cherokee_buffer_add_buffer (&node->request, &req->request);
49 49
 	}
50 50
 
51 51
 	/* Query string */
52 52
 	cherokee_buffer_init (&node->query_string);
53  
-	cherokee_buffer_add_buffer (&node->query_string, &conn->query_string);
  53
+	cherokee_buffer_add_buffer (&node->query_string, &req->query_string);
54 54
 
55 55
 	/* Encoder:
56 56
 	 * It will be filled in when the encoder object is instanced
@@ -63,7 +63,7 @@ conn_to_node (cherokee_request_t       *conn,
63 63
 
64 64
 static ret_t
65 65
 node_new (cherokee_avl_flcache_node_t **node,
66  
-	  cherokee_request_t        *conn)
  66
+	  cherokee_request_t           *req)
67 67
 {
68 68
 	CHEROKEE_NEW_STRUCT (n, avl_flcache_node);
69 69
 
@@ -71,14 +71,14 @@ node_new (cherokee_avl_flcache_node_t **node,
71 71
 	cherokee_buffer_init (&n->file);
72 72
 	CHEROKEE_MUTEX_INIT (&n->ref_count_mutex, CHEROKEE_MUTEX_FAST);
73 73
 
74  
-	n->conn_ref    = NULL;
  74
+	n->req_ref    = NULL;
75 75
 	n->status      = flcache_status_undef;
76 76
 	n->ref_count   = 0;
77 77
 	n->file_size   = 0;
78 78
 	n->valid_until = TIME_MAX;
79 79
 	n->created_at  = cherokee_bogonow_now;
80 80
 
81  
-	conn_to_node (conn, n);
  81
+	req_to_node (req, n);
82 82
 
83 83
 	*node = n;
84 84
 	return ret_ok;
@@ -115,27 +115,27 @@ cmp_request (cherokee_avl_flcache_node_t *A,
115 115
 	     cherokee_avl_flcache_node_t *B)
116 116
 {
117 117
 	int                          re;
118  
-	cherokee_request_t       *conn;
  118
+	cherokee_request_t          *req;
119 119
 	cherokee_avl_flcache_node_t *node;
120 120
 	cherokee_boolean_t           invert;
121 121
 
122 122
 	/* Comparing against a cherokee_request_t
123 123
 	 */
124  
-	if (A->conn_ref || B->conn_ref) {
125  
-		if (A->conn_ref) {
126  
-			conn   = A->conn_ref;
  124
+	if (A->req_ref || B->req_ref) {
  125
+		if (A->req_ref) {
  126
+			req   = A->req_ref;
127 127
 			node   = B;
128 128
 			invert = false;
129 129
 		} else {
130  
-			conn = B->conn_ref;
  130
+			req = B->req_ref;
131 131
 			node = A;
132 132
 			invert = true;
133 133
 		}
134 134
 
135  
-		if (conn->request_original.len > 0) {
136  
-			re = cherokee_buffer_case_cmp_buf (&conn->request_original, &node->request);
  135
+		if (req->request_original.len > 0) {
  136
+			re = cherokee_buffer_case_cmp_buf (&req->request_original, &node->request);
137 137
 		} else {
138  
-			re = cherokee_buffer_case_cmp_buf (&conn->request, &node->request);
  138
+			re = cherokee_buffer_case_cmp_buf (&req->request, &node->request);
139 139
 		}
140 140
 
141 141
 		return (invert) ? -re : re;
@@ -151,27 +151,27 @@ cmp_query_string (cherokee_avl_flcache_node_t *A,
151 151
 		  cherokee_avl_flcache_node_t *B)
152 152
 {
153 153
 	int                          re;
154  
-	cherokee_request_t       *conn;
  154
+	cherokee_request_t       *req;
155 155
 	cherokee_avl_flcache_node_t *node;
156 156
 	cherokee_boolean_t           invert;
157 157
 
158 158
 	/* Comparing against a cherokee_request_t
159 159
 	 */
160  
-	if (A->conn_ref || B->conn_ref) {
161  
-		if (A->conn_ref) {
162  
-			conn   = A->conn_ref;
  160
+	if (A->req_ref || B->req_ref) {
  161
+		if (A->req_ref) {
  162
+			req   = A->req_ref;
163 163
 			node   = B;
164 164
 			invert = false;
165 165
 		} else {
166  
-			conn = B->conn_ref;
  166
+			req = B->req_ref;
167 167
 			node = A;
168 168
 			invert = true;
169 169
 		}
170 170
 
171  
-		if (conn->query_string_original.len > 0) {
172  
-			re = cherokee_buffer_case_cmp_buf (&conn->query_string_original, &node->query_string);
  171
+		if (req->query_string_original.len > 0) {
  172
+			re = cherokee_buffer_case_cmp_buf (&req->query_string_original, &node->query_string);
173 173
 		} else {
174  
-			re = cherokee_buffer_case_cmp_buf (&conn->query_string, &node->query_string);
  174
+			re = cherokee_buffer_case_cmp_buf (&req->query_string, &node->query_string);
175 175
 		}
176 176
 
177 177
 		return (invert) ? -re : re;
@@ -189,7 +189,7 @@ cmp_encoding (cherokee_avl_flcache_node_t *A,
189 189
 	ret_t                        ret;
190 190
 	int                          re;
191 191
 	char                        *p;
192  
-	cherokee_request_t       *conn;
  192
+	cherokee_request_t          *req;
193 193
 	cherokee_avl_flcache_node_t *node;
194 194
 	cherokee_boolean_t           invert;
195 195
 	char                        *header      = NULL;
@@ -197,20 +197,20 @@ cmp_encoding (cherokee_avl_flcache_node_t *A,
197 197
 
198 198
 	/* Comparing against a cherokee_request_t
199 199
 	 */
200  
-	if (A->conn_ref || B->conn_ref) {
201  
-		if (A->conn_ref) {
202  
-			conn   = A->conn_ref;
  200
+	if (A->req_ref || B->req_ref) {
  201
+		if (A->req_ref) {
  202
+			req   = A->req_ref;
203 203
 			node   = B;
204 204
 			invert = false;
205 205
 		} else {
206  
-			conn = B->conn_ref;
  206
+			req = B->req_ref;
207 207
 			node = A;
208 208
 			invert = true;
209 209
 		}
210 210
 
211 211
  		/* No "Content-encoding:"
212 212
 		 */
213  
-		ret = cherokee_header_get_known (&conn->header, header_accept_encoding, &header, &header_len);
  213
+		ret = cherokee_header_get_known (&req->header, header_accept_encoding, &header, &header_len);
214 214
 		if (ret != ret_ok) {
215 215
 			/* Node not encoded */
216 216
 			if (cherokee_buffer_is_empty (&node->content_encoding)) {
@@ -319,7 +319,7 @@ node_is_empty (cherokee_avl_flcache_node_t *key)
319 319
 	 * 1.- A reference to a cherokee_request_t object
320 320
 	 * 2.- An object storing information
321 321
 	 */
322  
-	if (key->conn_ref)
  322
+	if (key->req_ref)
323 323
 		return false;
324 324
 
325 325
 	return cherokee_buffer_is_empty (&key->request);
@@ -354,13 +354,13 @@ cherokee_avl_flcache_mrproper (cherokee_avl_flcache_t *avl,
354 354
 
355 355
 ret_t
356 356
 cherokee_avl_flcache_add (cherokee_avl_flcache_t       *avl,
357  
-			  cherokee_request_t        *conn,
  357
+			  cherokee_request_t           *req,
358 358
 			  cherokee_avl_flcache_node_t **node)
359 359
 {
360 360
 	ret_t                       ret;
361 361
 	cherokee_avl_flcache_node_t *n   = NULL;
362 362
 
363  
-	ret = node_new (&n, conn);
  363
+	ret = node_new (&n, req);
364 364
 	if ((ret != ret_ok) || (n == NULL)) {
365 365
 		node_free (n);
366 366
 		return ret;
@@ -382,13 +382,13 @@ cherokee_avl_flcache_add (cherokee_avl_flcache_t       *avl,
382 382
 
383 383
 ret_t
384 384
 cherokee_avl_flcache_get (cherokee_avl_flcache_t       *avl,
385  
-			  cherokee_request_t        *conn,
  385
+			  cherokee_request_t           *req,
386 386
 			  cherokee_avl_flcache_node_t **node)
387 387
 {
388 388
 	ret_t                       ret;
389 389
 	cherokee_avl_flcache_node_t tmp;
390 390
 
391  
-	tmp.conn_ref = conn;
  391
+	tmp.req_ref = req;
392 392
 
393 393
 	CHEROKEE_RWLOCK_READER (&avl->base_rwlock);
394 394
 	ret = cherokee_avl_generic_get (AVL_GENERIC(avl), AVL_GENERIC_NODE(&tmp), (void **)node);
2  cherokee/avl_flcache.h
@@ -54,7 +54,7 @@ typedef struct {
54 54
 	cherokee_buffer_t            query_string;
55 55
 	cherokee_buffer_t            content_encoding;
56 56
 
57  
-	cherokee_request_t       *conn_ref;
  57
+	cherokee_request_t          *req_ref;
58 58
 
59 59
 	cherokee_flcache_status_t    status;
60 60
 	cherokee_buffer_t            file;
8  cherokee/balancer.c
@@ -156,25 +156,25 @@ cherokee_balancer_configure_base (cherokee_balancer_t    *balancer,
156 156
 
157 157
 ret_t
158 158
 cherokee_balancer_dispatch (cherokee_balancer_t    *balancer,
159  
-			    cherokee_request_t  *conn,
  159
+			    cherokee_request_t     *req,
160 160
 			    cherokee_source_t     **source)
161 161
 {
162 162
 	if (unlikely (balancer->dispatch == NULL))
163 163
 		return ret_error;
164 164
 
165  
-	return balancer->dispatch (balancer, conn, source);
  165
+	return balancer->dispatch (balancer, req, source);
166 166
 }
167 167
 
168 168
 
169 169
 ret_t
170 170
 cherokee_balancer_report_fail (cherokee_balancer_t   *balancer,
171  
-			       cherokee_request_t *conn,
  171
+			       cherokee_request_t    *req,
172 172
 			       cherokee_source_t     *source)
173 173
 {
174 174
 	if (unlikely (balancer->report_fail == NULL))
175 175
 		return ret_error;
176 176
 
177  
-	return balancer->report_fail (balancer, conn, source);
  177
+	return balancer->report_fail (balancer, req, source);
178 178
 }
179 179
 
180 180
 
8  cherokee/balancer_failover.c
@@ -118,7 +118,7 @@ reactivate_all_entries (cherokee_balancer_failover_t *balancer)
118 118
 
119 119
 static ret_t
120 120
 report_fail (cherokee_balancer_failover_t *balancer,
121  
-	     cherokee_request_t        *conn,
  121
+	     cherokee_request_t           *req,
122 122
 	     cherokee_source_t            *src)
123 123
 {
124 124
 	ret_t                      ret;
@@ -126,7 +126,7 @@ report_fail (cherokee_balancer_failover_t *balancer,
126 126
 	cherokee_balancer_entry_t *entry;
127 127
 	cherokee_buffer_t          tmp   = CHEROKEE_BUF_INIT;
128 128
 
129  
-	UNUSED(conn);
  129
+	UNUSED(req);
130 130
 
131 131
 	CHEROKEE_MUTEX_LOCK (&balancer->mutex);
132 132
 
@@ -169,14 +169,14 @@ report_fail (cherokee_balancer_failover_t *balancer,
169 169
 
170 170
 static ret_t
171 171
 dispatch (cherokee_balancer_failover_t  *balancer,
172  
-	  cherokee_request_t         *conn,
  172
+	  cherokee_request_t            *req,
173 173
 	  cherokee_source_t            **src)
174 174
 {
175 175
 	cherokee_list_t           *i;
176 176
 	cherokee_balancer_entry_t *entry = NULL;
177 177
 	cherokee_balancer_t       *gbal  = BAL(balancer);
178 178
 
179  
-	UNUSED(conn);
  179
+	UNUSED(req);
180 180
 	CHEROKEE_MUTEX_LOCK (&balancer->mutex);
181 181
 
182 182
 	/* Pick the first available source
8  cherokee/balancer_ip_hash.c
@@ -104,7 +104,7 @@ reactivate_entry (cherokee_balancer_ip_hash_t *balancer,
104 104
 
105 105
 static ret_t
106 106
 report_fail (cherokee_balancer_ip_hash_t *balancer,
107  
-	     cherokee_request_t       *conn,
  107
+	     cherokee_request_t          *req,
108 108
 	     cherokee_source_t           *src)
109 109
 {
110 110
 	ret_t                      ret;
@@ -112,7 +112,7 @@ report_fail (cherokee_balancer_ip_hash_t *balancer,
112 112
 	cherokee_balancer_entry_t *entry;
113 113
 	cherokee_buffer_t          tmp    = CHEROKEE_BUF_INIT;
114 114
 
115  
-	UNUSED(conn);
  115
+	UNUSED(req);
116 116
 
117 117
 	CHEROKEE_MUTEX_LOCK (&balancer->mutex);
118 118
 
@@ -157,7 +157,7 @@ report_fail (cherokee_balancer_ip_hash_t *balancer,
157 157
 
158 158
 static ret_t
159 159
 dispatch (cherokee_balancer_ip_hash_t  *balancer,
160  
-	  cherokee_request_t        *conn,
  160
+	  cherokee_request_t           *req,
161 161
 	  cherokee_source_t           **src)
162 162
 {
163 163
 	cint_t                     n;
@@ -166,7 +166,7 @@ dispatch (cherokee_balancer_ip_hash_t  *balancer,
166 166
 	cherokee_list_t           *i;
167 167
 	cherokee_balancer_entry_t *entry  = NULL;
168 168
 	culong_t                   hash   = 0;
169  
-	cherokee_socket_t         *socket = &conn->socket;
  169
+	cherokee_socket_t         *socket = &req->socket;
170 170
 
171 171
 	CHEROKEE_MUTEX_LOCK (&balancer->mutex);
172 172
 
8  cherokee/balancer_round_robin.c
@@ -87,14 +87,14 @@ reactivate_entry (cherokee_balancer_entry_t *entry)
87 87
 
88 88
 static ret_t
89 89
 dispatch (cherokee_balancer_round_robin_t *balancer,
90  
-	  cherokee_request_t           *conn,
  90
+	  cherokee_request_t              *req,
91 91
 	  cherokee_source_t              **src)
92 92
 {
93 93
 	cherokee_balancer_entry_t *entry;
94 94
 	cuint_t                    tries  = 0;
95 95
 	cherokee_balancer_t       *gbal   = BAL(balancer);
96 96
 
97  
-	UNUSED(conn);
  97
+	UNUSED(req);
98 98
 	CHEROKEE_MUTEX_LOCK (&balancer->mutex);
99 99
 
100 100
 	/* Pick the next entry */
@@ -135,7 +135,7 @@ dispatch (cherokee_balancer_round_robin_t *balancer,
135 135
 
136 136
 static ret_t
137 137
 report_fail (cherokee_balancer_round_robin_t *balancer,
138  
-	     cherokee_request_t           *conn,
  138
+	     cherokee_request_t              *req,
139 139
 	     cherokee_source_t               *src)
140 140
 {
141 141
 	ret_t                      ret;
@@ -143,7 +143,7 @@ report_fail (cherokee_balancer_round_robin_t *balancer,
143 143
 	cherokee_balancer_entry_t *entry;
144 144
 	cherokee_buffer_t          tmp    = CHEROKEE_BUF_INIT;
145 145
 
146  
-	UNUSED(conn);
  146
+	UNUSED(req);
147 147
 	CHEROKEE_MUTEX_LOCK (&balancer->mutex);
148 148
 
149 149
 	list_for_each (i, &BAL(balancer)->entries) {
2  cherokee/cherokee.h
@@ -74,7 +74,7 @@
74 74
 /* Config library
75 75
  */
76 76
 #include <cherokee/admin_client.h>
77  
-#include <cherokee/connection_info.h>
  77
+#include <cherokee/request_info.h>
78 78
 
79 79
 
80 80
 #undef CHEROKEE_INSIDE_CHEROKEE_H
4  cherokee/cryptor.c
@@ -204,13 +204,13 @@ ret_t
204 204
 cherokee_cryptor_socket_init_tls (cherokee_cryptor_socket_t *cryp,
205 205
 				  void                      *sock,
206 206
 				  void                      *vsrv,
207  
-				  void                      *conn,
  207
+				  void                      *req,
208 208
 				  void                      *blocking)
209 209
 {
210 210
 	if (unlikely (cryp->init_tls == NULL))
211 211
 		return ret_error;
212 212
 
213  
-	return cryp->init_tls (cryp, sock, vsrv, conn, blocking);
  213
+	return cryp->init_tls (cryp, sock, vsrv, req, blocking);
214 214
 }
215 215
 
216 216
 ret_t
4  cherokee/cryptor.h
@@ -52,7 +52,7 @@ typedef ret_t (* cryptor_vsrv_func_free_t)      (void  *cryp);
52 52
 /* Cryptor: Socket */
53 53
 typedef ret_t (* cryptor_socket_func_free_t)    (void *cryp);
54 54
 typedef ret_t (* cryptor_socket_func_clean_t)   (void *cryp);
55  
-typedef ret_t (* cryptor_socket_func_init_tls_t)(void *cryp, void *sock, void *vsrv, void *conn, void *blocking);
  55
+typedef ret_t (* cryptor_socket_func_init_tls_t)(void *cryp, void *sock, void *vsrv, void *req, void *blocking);
56 56
 typedef ret_t (* cryptor_socket_func_shutdown_t)(void *cryp);
57 57
 typedef ret_t (* cryptor_socket_func_read_t)    (void *cryp, char *buf, int len, size_t *re_len);
58 58
 typedef ret_t (* cryptor_socket_func_write_t)   (void *cryp, char *buf, int len, size_t *re_len);
@@ -161,7 +161,7 @@ ret_t cherokee_cryptor_socket_shutdown    (cherokee_cryptor_socket_t *cryp);
161 161
 ret_t cherokee_cryptor_socket_init_tls    (cherokee_cryptor_socket_t *cryp,
162 162
 					   void                      *sock,
163 163
 					   void                      *vsrv,
164  
-					   void                      *conn,
  164
+					   void                      *req,
165 165
 					   void                      *blocking);
166 166
 ret_t cherokee_cryptor_socket_read        (cherokee_cryptor_socket_t *cryp,
167 167
 					   char                      *buf,
36  cherokee/cryptor_libssl.c
@@ -198,10 +198,10 @@ _vserver_free (cherokee_cryptor_vserver_libssl_t *cryp_vsrv)
198 198
 }
199 199
 
200 200
 ret_t
201  
-cherokee_cryptor_libssl_find_vserver (SSL *ssl,
202  
-				      cherokee_server_t     *srv,
203  
-				      cherokee_buffer_t     *servername,
204  
-				      cherokee_request_t *conn)
  201
+cherokee_cryptor_libssl_find_vserver (SSL                *ssl,
  202
+				      cherokee_server_t  *srv,
  203
+				      cherokee_buffer_t  *servername,
  204
+				      cherokee_request_t *req)
205 205
 {
206 206
 	ret_t                      ret;
207 207
 	cherokee_virtual_server_t *vsrv = NULL;
@@ -210,7 +210,7 @@ cherokee_cryptor_libssl_find_vserver (SSL *ssl,
210 210
 	/* Try to match the connection to a server
211 211
 	 */
212 212
 
213  
-	ret = cherokee_server_get_vserver(srv, servername, conn, &vsrv);
  213
+	ret = cherokee_server_get_vserver(srv, servername, req, &vsrv);
214 214
 	if ((ret != ret_ok) || (vsrv == NULL)) {
215 215
 		LOG_ERROR (CHEROKEE_ERROR_SSL_SRV_MATCH, servername->buf);
216 216
 		return ret_error;
@@ -257,17 +257,17 @@ openssl_sni_servername_cb (SSL *ssl, int *ad, void *arg)
257 257
 	ret_t                      ret;
258 258
 	int                        re;
259 259
 	const char                *servername;
260  
-	cherokee_request_t     *conn;
  260
+	cherokee_request_t        *req;
261 261
 	cherokee_buffer_t          tmp;
262  
-	cherokee_server_t         *srv       = SRV(arg);
263  
-	cherokee_virtual_server_t *vsrv      = NULL;
  262
+	cherokee_server_t         *srv          = SRV(arg);
  263
+	cherokee_virtual_server_t *vsrv         = NULL;
264 264
 
265 265
 	UNUSED(ad);
266 266
 
267 267
 	/* Get the pointer to the socket
268 268
 	 */
269  
-	conn = SSL_get_app_data (ssl);
270  
-	if (unlikely (conn == NULL)) {
  269
+	req = SSL_get_app_data (ssl);
  270
+	if (unlikely (req == NULL)) {
271 271
 		LOG_ERROR (CHEROKEE_ERROR_SSL_SOCKET, ssl);
272 272
 		return SSL_TLSEXT_ERR_ALERT_FATAL;
273 273
 	}
@@ -281,7 +281,7 @@ openssl_sni_servername_cb (SSL *ssl, int *ad, void *arg)
281 281
 	if (servername == NULL) {
282 282
 		/* Set the server name to the IP address if we couldn't get the host name via SNI
283 283
 		 */
284  
-		cherokee_socket_ntop (&conn->socket, tmp.buf, tmp.size);
  284
+		cherokee_socket_ntop (&req->socket, tmp.buf, tmp.size);
285 285
 		TRACE (ENTRIES, "No SNI: Did not provide a server name, using IP='%s' as servername.\n", tmp.buf);
286 286
 	} else {
287 287
 		cherokee_buffer_add (&tmp, servername, strlen(servername));
@@ -290,7 +290,7 @@ openssl_sni_servername_cb (SSL *ssl, int *ad, void *arg)
290 290
 
291 291
 	/* Look up and change the vserver
292 292
 	 */
293  
-	ret = cherokee_cryptor_libssl_find_vserver(ssl, srv, &tmp, conn);
  293
+	ret = cherokee_cryptor_libssl_find_vserver(ssl, srv, &tmp, req);
294 294
 	if (ret != ret_ok) {
295 295
 		re = SSL_TLSEXT_ERR_NOACK;
296 296
 	}
@@ -533,7 +533,7 @@ static ret_t
533 533
 socket_initialize (cherokee_cryptor_socket_libssl_t *cryp,
534 534
 		   cherokee_socket_t                *socket,
535 535
 		   cherokee_virtual_server_t        *vserver,
536  
-		   cherokee_request_t            *conn)
  536
+		   cherokee_request_t               *req)
537 537
 {
538 538
 	int                                re;
539 539
 	const char                        *error;
@@ -581,13 +581,13 @@ socket_initialize (cherokee_cryptor_socket_libssl_t *cryp,
581 581
 	}
582 582
 
583 583
 #ifndef OPENSSL_NO_TLSEXT
584  
-	SSL_set_app_data (cryp->session, conn);
  584
+	SSL_set_app_data (cryp->session, req);
585 585
 #else
586 586
 	/* Attempt to determine the vserver without SNI.
587 587
 	 */
588 588
 	cherokee_buffer_ensure_size(&servername, 40);
589  
-	cherokee_socket_ntop (&conn->socket, servername.buf, servername.size);
590  
-	cherokee_cryptor_libssl_find_vserver (cryp->session, REQ_SRV(conn), &servername, conn);
  589
+	cherokee_socket_ntop (&req->socket, servername.buf, servername.size);
  590
+	cherokee_cryptor_libssl_find_vserver (cryp->session, REQ_SRV(req), &servername, req);
591 591
 	cherokee_buffer_mrproper (&servername);
592 592
 #endif
593 593
 
@@ -599,7 +599,7 @@ static ret_t
599 599
 _socket_init_tls (cherokee_cryptor_socket_libssl_t *cryp,
600 600
 		  cherokee_socket_t                *sock,
601 601
 		  cherokee_virtual_server_t        *vsrv,
602  
-		  cherokee_request_t            *conn,
  602
+		  cherokee_request_t               *req,
603 603
 		  cherokee_socket_status_t         *blocking)
604 604
 {
605 605
 	int   re;
@@ -608,7 +608,7 @@ _socket_init_tls (cherokee_cryptor_socket_libssl_t *cryp,
608 608
 	/* Initialize
609 609
 	 */
610 610
 	if (CRYPTOR_SOCKET(cryp)->initialized == false) {
611  
-		ret = socket_initialize (cryp, sock, vsrv, conn);
  611
+		ret = socket_initialize (cryp, sock, vsrv, req);
612 612
 		if (ret != ret_ok) {
613 613
 			return ret_error;
614 614
 		}
6  cherokee/encoder.c
@@ -127,13 +127,13 @@ cherokee_encoder_add_headers (cherokee_encoder_t *enc, cherokee_buffer_t *buf)
127 127
 
128 128
 
129 129
 ret_t
130  
-cherokee_encoder_init (cherokee_encoder_t *enc, void *conn)
  130
+cherokee_encoder_init (cherokee_encoder_t *enc, void *req)
131 131
 {
132 132
 	encoder_func_init_t init_func;
133 133
 
134 134
 	/* Properties
135 135
 	 */
136  
-	enc->conn = conn;
  136
+	enc->req = req;
137 137
 
138 138
 	/* Call the virtual method
139 139
 	 */
@@ -141,7 +141,7 @@ cherokee_encoder_init (cherokee_encoder_t *enc, void *conn)
141 141
 	if (init_func == NULL)
142 142
 		return ret_error;
143 143
 
144  
-	return init_func (enc, conn);
  144
+	return init_func (enc, req);
145 145
 }
146 146
 
147 147
 
8  cherokee/encoder.h
@@ -48,7 +48,7 @@ typedef enum {
48 48
 typedef ret_t (* encoder_func_new_t)         (void **encoder, void *props);
49 49
 typedef ret_t (* encoder_func_free_t)        (void  *encoder);
50 50
 typedef ret_t (* encoder_func_add_headers_t) (void  *encoder, cherokee_buffer_t *buf);
51  
-typedef ret_t (* encoder_func_init_t)        (void  *encoder, void *conn);
  51
+typedef ret_t (* encoder_func_init_t)        (void  *encoder, void *req);
52 52
 typedef ret_t (* encoder_func_encode_t)      (void  *encoder, cherokee_buffer_t *in, cherokee_buffer_t *out);
53 53
 typedef ret_t (* encoder_func_flush_t)       (void  *encoder, cherokee_buffer_t *in, cherokee_buffer_t *out);
54 54
 typedef ret_t (* encoder_func_configure_t)   (cherokee_config_node_t *, cherokee_server_t *, cherokee_module_props_t **);
@@ -78,11 +78,11 @@ typedef struct {
78 78
 
79 79
 	/* Properties
80 80
 	 */
81  
-	void                      *conn;
  81
+	void                      *req;
82 82
 } cherokee_encoder_t;
83 83
 
84 84
 #define ENCODER(x)      ((cherokee_encoder_t *)(x))
85  
-#define ENCODER_REQ(x)  (REQ(ENCODER(x)->conn))
  85
+#define ENCODER_REQ(x)  (REQ(ENCODER(x)->req))
86 86
 
87 87
 
88 88
 /* Easy initialization
@@ -126,7 +126,7 @@ ret_t cherokee_encoder_props_free_base (cherokee_encoder_props_t *encoder_props)
126 126
  */
127 127
 ret_t cherokee_encoder_free        (cherokee_encoder_t *enc);
128 128
 ret_t cherokee_encoder_add_headers (cherokee_encoder_t *enc, cherokee_buffer_t *buf);
129  
-ret_t cherokee_encoder_init        (cherokee_encoder_t *enc, void *conn);
  129
+ret_t cherokee_encoder_init        (cherokee_encoder_t *enc, void *req);
130 130
 ret_t cherokee_encoder_encode      (cherokee_encoder_t *enc, cherokee_buffer_t *in, cherokee_buffer_t *out);
131 131
 ret_t cherokee_encoder_flush       (cherokee_encoder_t *enc, cherokee_buffer_t *in, cherokee_buffer_t *out);
132 132
 
4  cherokee/encoder_deflate.c
@@ -161,12 +161,12 @@ get_deflate_error_string (int err)
161 161
 
162 162
 ret_t
163 163
 cherokee_encoder_deflate_init (cherokee_encoder_deflate_t *encoder,
164  
-			       cherokee_request_t      *conn)
  164
+			       cherokee_request_t         *req)
165 165
 {
166 166
 	int       err;
167 167
 	z_stream *z = &encoder->stream;
168 168
 
169  
-	UNUSED (conn);
  169
+	UNUSED (req);
170 170
 
171 171
 	/* Set the workspace
172 172
 	 */
2  cherokee/encoder_deflate.h
@@ -64,7 +64,7 @@ ret_t cherokee_encoder_deflate_new         (cherokee_encoder_deflate_t **encoder
64 64
 ret_t cherokee_encoder_deflate_free        (cherokee_encoder_deflate_t  *encoder);
65 65
 
66 66
 ret_t cherokee_encoder_deflate_add_headers (cherokee_encoder_deflate_t  *encoder, cherokee_buffer_t *buf);
67  
-ret_t cherokee_encoder_deflate_init        (cherokee_encoder_deflate_t  *encoder, cherokee_request_t *conn);
  67
+ret_t cherokee_encoder_deflate_init        (cherokee_encoder_deflate_t  *encoder, cherokee_request_t *req);
68 68
 ret_t cherokee_encoder_deflate_encode      (cherokee_encoder_deflate_t  *encoder, cherokee_buffer_t *in, cherokee_buffer_t *out);
69 69
 ret_t cherokee_encoder_deflate_flush       (cherokee_encoder_deflate_t  *encoder, cherokee_buffer_t *in, cherokee_buffer_t *out);
70 70
 
8  cherokee/encoder_gzip.c
@@ -210,7 +210,7 @@ get_gzip_error_string (int err)
210 210
 }
211 211
 
212 212
 static cherokee_boolean_t
213  
-is_user_agent_IE_16 (cherokee_request_t *conn)
  213
+is_user_agent_IE_16 (cherokee_request_t *req)
214 214
 {
215 215
 	ret_t     ret;
216 216
 	char     *m;
@@ -219,7 +219,7 @@ is_user_agent_IE_16 (cherokee_request_t *conn)
219 219
 
220 220
 	/* Get the User-Agent header
221 221
 	 */
222  
-	ret = cherokee_header_get_known (&conn->header, header_user_agent, &ref, &ref_len);
  222
+	ret = cherokee_header_get_known (&req->header, header_user_agent, &ref, &ref_len);
223 223
 	if ((ret != ret_ok) || (ref == NULL) || (ref_len <= 7)) {
224 224
 		return false;
225 225
 	}
@@ -240,7 +240,7 @@ is_user_agent_IE_16 (cherokee_request_t *conn)
240 240
 
241 241
 ret_t
242 242
 cherokee_encoder_gzip_init (cherokee_encoder_gzip_t *encoder,
243  
-			    cherokee_request_t   *conn)
  243
+			    cherokee_request_t      *req)
244 244
 {
245 245
 	int       err;
246 246
 	z_stream *z    = &encoder->stream;
@@ -248,7 +248,7 @@ cherokee_encoder_gzip_init (cherokee_encoder_gzip_t *encoder,
248 248
 	/* Disable GZip for IE 1-6 clients
249 249
 	 */
250 250
 	if (likely (ENC_GZIP_PROP(encoder)->disable_old_IE)) {
251  
-		if (is_user_agent_IE_16 (conn)) {
  251
+		if (is_user_agent_IE_16 (req)) {
252 252
 			TRACE (ENTRIES, "Disabling encoder: %s\n", "MSIE [1-6] detected\n");
253 253
 			return ret_deny;
254 254
 		}
2  cherokee/encoder_gzip.h
@@ -67,7 +67,7 @@ ret_t cherokee_encoder_gzip_new         (cherokee_encoder_gzip_t **encoder, cher
67 67
 ret_t cherokee_encoder_gzip_free        (cherokee_encoder_gzip_t  *encoder);
68 68
 
69 69
 ret_t cherokee_encoder_gzip_add_headers (cherokee_encoder_gzip_t  *encoder, cherokee_buffer_t *buf);
70  
-ret_t cherokee_encoder_gzip_init        (cherokee_encoder_gzip_t  *encoder, cherokee_request_t *conn);
  70
+ret_t cherokee_encoder_gzip_init        (cherokee_encoder_gzip_t  *encoder, cherokee_request_t *req);
71 71
 ret_t cherokee_encoder_gzip_encode      (cherokee_encoder_gzip_t  *encoder, cherokee_buffer_t *in, cherokee_buffer_t *out);
72 72
 ret_t cherokee_encoder_gzip_flush       (cherokee_encoder_gzip_t  *encoder, cherokee_buffer_t *in, cherokee_buffer_t *out);
73 73
 
144  cherokee/flcache.c
@@ -173,18 +173,18 @@ cherokee_flcache_configure (cherokee_flcache_t     *flcache,
173 173
 
174 174
 
175 175
 ret_t
176  
-cherokee_flcache_req_get_cached (cherokee_flcache_t    *flcache,
177  
-				 cherokee_request_t *conn)
  176
+cherokee_flcache_req_get_cached (cherokee_flcache_t *flcache,
  177
+				 cherokee_request_t *req)
178 178
 {
179 179
 	ret_t                        ret;
180 180
 	cherokee_avl_flcache_node_t *entry = NULL;
181 181
 
182 182
 	/* Check the cache
183 183
 	 */
184  
-	ret = cherokee_avl_flcache_get (&flcache->request_map, conn, &entry);
  184
+	ret = cherokee_avl_flcache_get (&flcache->request_map, req, &entry);
185 185
 	if ((ret != ret_ok) || (entry == NULL)) {
186 186
 		TRACE (ENTRIES, "Front Line Cache: miss: '%s' qs='%s'\n",
187  
-		       conn->request.buf, conn->query_string.buf ? conn->query_string.buf : "");
  187
+		       req->request.buf, req->query_string.buf ? req->query_string.buf : "");
188 188
 		return ret_not_found;
189 189
 	}
190 190
 
@@ -192,7 +192,7 @@ cherokee_flcache_req_get_cached (cherokee_flcache_t    *flcache,
192 192
 	 */
193 193
 	if (entry->status != flcache_status_ready) {
194 194
 		TRACE (ENTRIES, "Front Line Cache: almost-hit; '%s' being cached (%d refs)\n",
195  
-		       conn->request.buf, entry->ref_count);
  195
+		       req->request.buf, entry->ref_count);
196 196
 		return ret_deny;
197 197
 	}
198 198
 
@@ -200,7 +200,7 @@ cherokee_flcache_req_get_cached (cherokee_flcache_t    *flcache,
200 200
 	 */
201 201
 	if (entry->valid_until < cherokee_bogonow_now) {
202 202
 		TRACE (ENTRIES, "Front Line Cache: almost-hit; '%s' expired already (%d refs)\n",
203  
-		       conn->request.buf, entry->ref_count);
  203
+		       req->request.buf, entry->ref_count);
204 204
 
205 205
 		if (entry->ref_count == 0) {
206 206
 			cherokee_flcache_del_entry (flcache, entry);
@@ -211,13 +211,13 @@ cherokee_flcache_req_get_cached (cherokee_flcache_t    *flcache,
211 211
 
212 212
 	/* Cache hit: Open the cached file
213 213
 	 */
214  
-	conn->flcache.fd = cherokee_open (entry->file.buf, O_RDONLY | O_NOFOLLOW, 0);
215  
-	if (unlikely (conn->flcache.fd == -1)) {
  214
+	req->flcache.fd = cherokee_open (entry->file.buf, O_RDONLY | O_NOFOLLOW, 0);
  215
+	if (unlikely (req->flcache.fd == -1)) {
216 216
 		return ret_error;
217 217
 	}
218 218
 
219 219
 	TRACE (ENTRIES, "Front Line Cache: hit; '%s' -> '%s' (%d refs)\n",
220  
-	       conn->request.buf, entry->file.buf, entry->ref_count);
  220
+	       req->request.buf, entry->file.buf, entry->ref_count);
221 221
 
222 222
 	/* Store the reference to the object
223 223
 	 */
@@ -225,60 +225,60 @@ cherokee_flcache_req_get_cached (cherokee_flcache_t    *flcache,
225 225
 	entry->ref_count += 1;
226 226
 	CHEROKEE_MUTEX_UNLOCK (&entry->ref_count_mutex);
227 227
 
228  
-	conn->flcache.avl_node_ref = entry;
229  
-	conn->flcache.mode         = flcache_mode_out;
  228
+	req->flcache.avl_node_ref = entry;
  229
+	req->flcache.mode         = flcache_mode_out;
230 230
 
231 231
 	return ret_ok;
232 232
 }
233 233
 
234 234
 
235 235
 ret_t
236  
-cherokee_flcache_req_is_storable (cherokee_flcache_t    *flcache,
237  
-				  cherokee_request_t *conn)
  236
+cherokee_flcache_req_is_storable (cherokee_flcache_t *flcache,
  237
+				  cherokee_request_t *req)
238 238
 {
239 239
 	UNUSED (flcache);
240 240
 
241 241
 	/* HTTP Method
242 242
 	 */
243  
-	if (conn->header.method != http_get) {
244  
-		TRACE (ENTRIES, "Not storable: method(%d) != GET\n", conn->header.method);
  243
+	if (req->header.method != http_get) {
  244
+		TRACE (ENTRIES, "Not storable: method(%d) != GET\n", req->header.method);
245 245
 		return ret_deny;
246 246
 	}
247 247
 
248 248
 	/* HTTPs
249 249
 	 */
250  
-	if (conn->socket.is_tls == TLS) {
  250
+	if (req->socket.is_tls == TLS) {
251 251
 		TRACE (ENTRIES, "Not storable: Connection is %s\n", "TLS");
252 252
 		return ret_deny;
253 253
 	}
254 254
 
255 255
 	/* Authenticated
256 256
 	 */
257  
-	if (conn->validator != NULL) {
  257
+	if (req->validator != NULL) {
258 258
 		TRACE (ENTRIES, "Not storable: Content requires %s\n", "authentication");
259 259
 		return ret_deny;
260 260
 	}
261 261
 
262 262
 	/* Expiration
263 263
 	 */
264  
-	if (conn->expiration == cherokee_expiration_epoch) {
  264
+	if (req->expiration == cherokee_expiration_epoch) {
265 265
 		TRACE (ENTRIES, "Not storable: Alredy expired at '%s'\n", "epoch");
266 266
 		return ret_deny;
267 267
 	}
268 268
 
269  
-	if ((conn->expiration_prop & cherokee_expiration_prop_no_cache) ||
270  
-	    (conn->expiration_prop & cherokee_expiration_prop_no_store) ||
271  
-	    (conn->expiration_prop & cherokee_expiration_prop_must_revalidate) ||
272  
-	    (conn->expiration_prop & cherokee_expiration_prop_proxy_revalidate))
  269
+	if ((req->expiration_prop & cherokee_expiration_prop_no_cache) ||
  270
+	    (req->expiration_prop & cherokee_expiration_prop_no_store) ||
  271
+	    (req->expiration_prop & cherokee_expiration_prop_must_revalidate) ||
  272
+	    (req->expiration_prop & cherokee_expiration_prop_proxy_revalidate))
273 273
 	{
274  
-		TRACE (ENTRIES, "Not storable: Expiration props: %d\n", conn->expiration_prop);
  274
+		TRACE (ENTRIES, "Not storable: Expiration props: %d\n", req->expiration_prop);
275 275
 		return ret_deny;
276 276
 	}
277 277
 
278 278
 	/* Range
279 279
 	 */
280  
-	if ((conn->range_end != -1) || (conn->range_start != -1)) {
281  
-		TRACE (ENTRIES, "Not storable: Requested a range (%d, %d)\n", conn->range_start, conn->range_end);
  280
+	if ((req->range_end != -1) || (req->range_start != -1)) {
  281
+		TRACE (ENTRIES, "Not storable: Requested a range (%d, %d)\n", req->range_start, req->range_end);
282 282
 		return ret_deny;
283 283
 	}
284 284
 
@@ -318,8 +318,8 @@ cherokee_flcache_conn_init (cherokee_flcache_conn_t *flcache_conn)
318 318
 
319 319
 
320 320
 ret_t
321  
-cherokee_flcache_req_set_store (cherokee_flcache_t    *flcache,
322  
-				cherokee_request_t *conn)
  321
+cherokee_flcache_req_set_store (cherokee_flcache_t *flcache,
  322
+				cherokee_request_t *req)
323 323
 {
324 324
 	ret_t                        ret;
325 325
 	int                          dir;
@@ -328,7 +328,7 @@ cherokee_flcache_req_set_store (cherokee_flcache_t    *flcache,
328 328
 
329 329
 	/* Add it to the tree
330 330
 	 */
331  
-	ret = cherokee_avl_flcache_add (&flcache->request_map, conn, &entry);
  331
+	ret = cherokee_avl_flcache_add (&flcache->request_map, req, &entry);
332 332
 	if ((ret != ret_ok) || (entry == NULL)) {
333 333
 		return ret;
334 334
 	}
@@ -356,8 +356,8 @@ cherokee_flcache_req_set_store (cherokee_flcache_t    *flcache,
356 356
 
357 357
 	/* Status
358 358
 	 */
359  
-	conn->flcache.mode         = flcache_mode_in;
360  
-	conn->flcache.avl_node_ref = entry;
  359
+	req->flcache.mode         = flcache_mode_in;
  360
+	req->flcache.avl_node_ref = entry;
361 361
 
362 362
 	return ret_ok;
363 363
 }
@@ -366,7 +366,7 @@ cherokee_flcache_req_set_store (cherokee_flcache_t    *flcache,
366 366
 static ret_t
367 367
 inspect_header (cherokee_flcache_conn_t *flcache_conn,
368 368
 		cherokee_buffer_t       *header,
369  
-		cherokee_request_t   *conn)
  369
+		cherokee_request_t      *req)
370 370
 {
371 371
 	ret_t                        ret;
372 372
 	char                        *value;
@@ -379,13 +379,13 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
379 379
 	cherokee_boolean_t           overwrite_control;
380 380
 	cherokee_avl_flcache_node_t *node               = flcache_conn->avl_node_ref;
381 381
 	cherokee_boolean_t           via_found          = false;
382  
-	cherokee_buffer_t           *tmp                = THREAD_TMP_BUF2(REQ_THREAD(conn));
  382
+	cherokee_buffer_t           *tmp                = THREAD_TMP_BUF2(REQ_THREAD(req));
383 383
 	cherokee_boolean_t           do_cache           = false;
384 384
 
385 385
 	begin      = header->buf;
386 386
 	header_end = header->buf + header->len;
387 387
 
388  
-	overwrite_control = (conn->expiration != cherokee_expiration_none);
  388
+	overwrite_control = (req->expiration != cherokee_expiration_none);
389 389
 
390 390
 	while ((begin < header_end)) {
391 391
 		end = cherokee_header_get_next_line (begin);
@@ -495,13 +495,13 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
495 495
 		/* Set-cookie
496 496
 		 */
497 497
 		else if (strncasecmp (begin, "Set-cookie:", 11) == 0) {
498  
-			if (conn->config_entry.flcache_cookies_disregard) {
  498
+			if (req->config_entry.flcache_cookies_disregard) {
499 499
 				int                 re;
500 500
 				void               *pcre;
501 501
 				cherokee_list_t    *i;
502 502
 				cherokee_boolean_t  matched = false;
503 503
 
504  
-				list_for_each (i, conn->config_entry.flcache_cookies_disregard) {
  504
+				list_for_each (i, req->config_entry.flcache_cookies_disregard) {
505 505
 					pcre = LIST_ITEM_INFO(i);
506 506
 
507 507
 					re = pcre_exec (pcre, NULL, begin, end-begin, 0, 0, NULL, 0);
@@ -536,7 +536,7 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
536 536
 			/* Build string */
537 537
 			cherokee_buffer_clean (tmp);
538 538
 			cherokee_buffer_add_str (tmp, ", ");
539  
-			cherokee_request_build_host_port_string (conn, tmp);
  539
+			cherokee_request_build_host_port_string (req, tmp);
540 540
 			cherokee_buffer_add_str (tmp, " (Cherokee/"PACKAGE_VERSION")");
541 541
 
542 542
 			/* Insert at the end */
@@ -570,7 +570,7 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
570 570
 	/* Check the caching policy
571 571
 	 */
572 572
 	if ((! do_cache) &&
573  
-	    (conn->config_entry.flcache_policy == flcache_policy_explicitly_allowed))
  573
+	    (req->config_entry.flcache_policy == flcache_policy_explicitly_allowed))
574 574
 	{
575 575
 		TRACE(ENTRIES, "Doesn't explicitly allow caching.%s", "\n");
576 576
 		return ret_deny;
@@ -580,14 +580,14 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
580 580
 	 */
581 581
 	if (! via_found) {
582 582
 		cherokee_buffer_add_str (header, "Via: ");
583  
-		cherokee_request_build_host_port_string (conn, header);
  583
+		cherokee_request_build_host_port_string (req, header);
584 584
 		cherokee_buffer_add_str (header, " (Cherokee/"PACKAGE_VERSION")" CRLF);
585 585
 	}
586 586
 
587 587
 	/* Overwritten Cache-Control / Expiration
588 588
 	 */
589 589
 	if (overwrite_control) {
590  
-		cherokee_request_add_expiration_header (conn, header, false);
  590
+		cherokee_request_add_expiration_header (req, header, false);
591 591
 	}
592 592
 
593 593
 	return ret_ok;
@@ -595,15 +595,15 @@ inspect_header (cherokee_flcache_conn_t *flcache_conn,
595 595
 
596 596
 
597 597
 static ret_t
598  
-create_flconn_file (cherokee_flcache_t    *flcache,
599  
-		    cherokee_request_t *conn)
  598
+create_flconn_file (cherokee_flcache_t *flcache,
  599
+		    cherokee_request_t *req)
600 600
 {
601 601
 	ret_t                        ret;
602 602
 	cherokee_buffer_t            tmp   = CHEROKEE_BUF_INIT;
603  
-	cherokee_avl_flcache_node_t *entry = conn->flcache.avl_node_ref;
  603
+	cherokee_avl_flcache_node_t *entry = req->flcache.avl_node_ref;
604 604
 
605  
-	conn->flcache.fd = cherokee_open (entry->file.buf, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, S_IRUSR|S_IWUSR);
606  
-	if (conn->flcache.fd == -1) {
  605
+	req->flcache.fd = cherokee_open (entry->file.buf, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, S_IRUSR|S_IWUSR);
  606
+	if (req->flcache.fd == -1) {
607 607
 		char *p;
608 608
 
609 609
 		/* Try to create 'dir'
@@ -625,14 +625,14 @@ create_flconn_file (cherokee_flcache_t    *flcache,
625 625
 
626 626
 		/* Second chance
627 627
 		 */
628  
-		conn->flcache.fd = cherokee_open (entry->file.buf, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, S_IRUSR|S_IWUSR);
629  
-		if (conn->flcache.fd == -1) {
  628
+		req->flcache.fd = cherokee_open (entry->file.buf, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, S_IRUSR|S_IWUSR);
  629
+		if (req->flcache.fd == -1) {
630 630
 			LOG_ERRNO (errno, cherokee_err_error, CHEROKEE_ERROR_FLCACHE_CREATE_FILE, tmp.buf);
631 631
 			goto error;
632 632
 		}
633 633
 	}
634 634
 
635  
-	TRACE (ENTRIES, "Created flcache file %s, fd=%d\n", entry->file.buf, conn->flcache.fd);
  635
+	TRACE (ENTRIES, "Created flcache file %s, fd=%d\n", entry->file.buf, req->flcache.fd);
636 636
 
637 637
 	cherokee_buffer_mrproper (&tmp);
638 638
 	return ret_ok;
@@ -644,38 +644,38 @@ create_flconn_file (cherokee_flcache_t    *flcache,
644 644
 
645 645
 ret_t
646 646
 cherokee_flcache_conn_commit_header (cherokee_flcache_conn_t *flcache_conn,
647  
-				     cherokee_request_t   *conn)
  647
+				     cherokee_request_t      *req)
648 648
 {
649 649
 	ret_t                        ret;
650 650
 	ssize_t                      written;
651  
-	cherokee_avl_flcache_node_t *entry    = conn->flcache.avl_node_ref;
  651
+	cherokee_avl_flcache_node_t *entry    = req->flcache.avl_node_ref;
652 652
 
653 653
 	/* Do not cache non-200 responses
654 654
 	 */
655  
-	if (conn->error_code != http_ok) {
  655
+	if (req->error_code != http_ok) {
656 656
 		TRACE (ENTRIES, "Front Line Cache: Non %d response. Cache object cancelled.\n", 200);
657 657
 
658 658
 		cherokee_flcache_conn_clean (flcache_conn);
659  
-		cherokee_flcache_del_entry (REQ_VSRV(conn)->flcache, entry);
  659
+		cherokee_flcache_del_entry (REQ_VSRV(req)->flcache, entry);
660 660
 
661 661
 		return ret_deny;
662 662
 	}
663 663
 
664 664
 	/* Inspect header
665 665
 	 */
666  
-	ret = inspect_header (flcache_conn, &flcache_conn->header, conn);
  666
+	ret = inspect_header (flcache_conn, &flcache_conn->header, req);
667 667
 	if (ret == ret_deny) {
668 668
 		cherokee_flcache_conn_clean (flcache_conn);
669  
-		cherokee_flcache_del_entry (REQ_VSRV(conn)->flcache, entry);
  669
+		cherokee_flcache_del_entry (REQ_VSRV(req)->flcache, entry);
670 670
 
671 671
 		return ret_ok;
672 672
 	}
673 673
 
674 674
 	/* Create the cache file
675 675
 	 */
676  
-	ret = create_flconn_file (REQ_VSRV(conn)->flcache, conn);
  676
+	ret = create_flconn_file (REQ_VSRV(req)->flcache, req);
677 677
 	if (ret != ret_ok) {
678  
-		cherokee_flcache_del_entry (REQ_VSRV(conn)->flcache, entry);
  678
+		cherokee_flcache_del_entry (REQ_VSRV(req)->flcache, entry);
679 679
 		return ret_error;
680 680
 	}
681 681
 
@@ -710,18 +710,18 @@ cherokee_flcache_conn_commit_header (cherokee_flcache_conn_t *flcache_conn,
710 710
 
711 711
 ret_t
712 712
 cherokee_flcache_conn_write_body (cherokee_flcache_conn_t *flcache_conn,
713  
-				  cherokee_request_t   *conn)
  713
+				  cherokee_request_t      *req)
714 714
 {
715 715
 	ssize_t written;
716 716
 
717 717
 	do {
718  
-		written = write (flcache_conn->fd, conn->buffer.buf, conn->buffer.len);
  718
+		written = write (flcache_conn->fd, req->buffer.buf, req->buffer.len);
719 719
 	} while ((written == -1) && (errno == EINTR));
720 720
 
721 721
 	TRACE (ENTRIES, "Writing body: %d bytes to fd=%d (%d has been written)\n",
722  
-	       conn->buffer.len, flcache_conn->fd, written);
  722
+	       req->buffer.len, flcache_conn->fd, written);
723 723
 
724  
-	if (unlikely (written != conn->buffer.len)) {
  724
+	if (unlikely (written != req->buffer.len)) {
725 725
 		return ret_error;
726 726
 	}
727 727
 
@@ -732,7 +732,7 @@ cherokee_flcache_conn_write_body (cherokee_flcache_conn_t *flcache_conn,
732 732
 
733 733
 ret_t
734 734
 cherokee_flcache_conn_send_header (cherokee_flcache_conn_t *flcache_conn,
735  
-				   cherokee_request_t   *conn)
  735
+				   cherokee_request_t      *req)
736 736
 {
737 737
 	ret_t   ret;
738 738
 	ssize_t got;
@@ -755,28 +755,28 @@ cherokee_flcache_conn_send_header (cherokee_flcache_conn_t *flcache_conn,
755 755
 
756 756
 	TRACE (ENTRIES, "Reading header: len %d from fd=%d\n", len, flcache_conn->fd);
757 757
 
758  
-	ret = cherokee_buffer_read_from_fd (&conn->header_buffer, flcache_conn->fd, len, &got2);
  758
+	ret = cherokee_buffer_read_from_fd (&req->header_buffer, flcache_conn->fd, len, &got2);
759 759
 	if (unlikely (ret != ret_ok)) {
760 760
 		return ret_error;
761 761
 	}
762 762
 
763 763
 	/* Add Content-Length
764 764
 	 */
765  
-	cherokee_buffer_add_str      (&conn->header_buffer, "Content-Length: ");
766  
-	cherokee_buffer_add_ullong10 (&conn->header_buffer, flcache_conn->avl_node_ref->file_size);
767  
-	cherokee_buffer_add_str      (&conn->header_buffer, CRLF);
  765
+	cherokee_buffer_add_str      (&req->header_buffer, "Content-Length: ");
  766
+	cherokee_buffer_add_ullong10 (&req->header_buffer, flcache_conn->avl_node_ref->file_size);
  767
+	cherokee_buffer_add_str      (&req->header_buffer, CRLF);
768 768
 
769 769
 	/* X-Cache
770 770
 	 */
771  
-	cherokee_buffer_add_str (&conn->header_buffer, "X-Cache: HIT from ");
772  
-	cherokee_request_build_host_port_string (conn, &conn->header_buffer);
773  
-	cherokee_buffer_add_str (&conn->header_buffer, CRLF);
  771
+	cherokee_buffer_add_str (&req->header_buffer, "X-Cache: HIT from ");
  772
+	cherokee_request_build_host_port_string (req, &req->header_buffer);
  773
+	cherokee_buffer_add_str (&req->header_buffer, CRLF);
774 774
 
775 775
 	/* Age (RFC2616, section 14.6)
776 776
 	 */
777  
-	cherokee_buffer_add_str    (&conn->header_buffer, "Age: ");
778  
-	cherokee_buffer_add_long10 (&conn->header_buffer, cherokee_bogonow_now - flcache_conn->avl_node_ref->created_at);
779  
-	cherokee_buffer_add_str    (&conn->header_buffer, CRLF);
  777
+	cherokee_buffer_add_str    (&req->header_buffer, "Age: ");
  778
+	cherokee_buffer_add_long10 (&req->header_buffer, cherokee_bogonow_now - flcache_conn->avl_node_ref->created_at);
  779
+	cherokee_buffer_add_str    (&req->header_buffer, CRLF);
780 780
 
781 781
 	return ret_ok;
782 782
 }
@@ -784,7 +784,7 @@ cherokee_flcache_conn_send_header (cherokee_flcache_conn_t *flcache_conn,
784 784
 
785 785
 ret_t
786 786
 cherokee_flcache_conn_send_body (cherokee_flcache_conn_t *flcache_conn,
787  
-				 cherokee_request_t   *conn)
  787
+				 cherokee_request_t      *req)
788 788
 {
789 789
 	ret_t              ret;
790 790
 	size_t             got = 0;
@@ -792,7 +792,7 @@ cherokee_flcache_conn_send_body (cherokee_flcache_conn_t *flcache_conn,
792 792
 
793 793
 	TRACE (ENTRIES, "Reading body from fd=%d\n", flcache_conn->fd);
794 794
 
795  
-	ret = cherokee_buffer_read_from_fd (&conn->buffer, flcache_conn->fd, DEFAULT_READ_SIZE, &got);
  795
+	ret = cherokee_buffer_read_from_fd (&req->buffer, flcache_conn->fd, DEFAULT_READ_SIZE, &got);
796 796
 
797 797
 	if (got != 0) {
798 798
 		flcache_conn->response_sent += got;
56  cherokee/gen_evhost.c
@@ -45,7 +45,7 @@ _free (cherokee_generic_evhost_t *evhost)
45 45
 }
46 46
 
47 47
 static ret_t
48  
-_check_document_root (cherokee_request_t *conn)
  48
+_check_document_root (cherokee_request_t *req)
49 49
 
50 50
 {
51 51
 	ret_t                     ret;
@@ -53,9 +53,9 @@ _check_document_root (cherokee_request_t *conn)
53 53
 	struct stat              *info;
54 54
 	cherokee_iocache_entry_t *io_entry = NULL;
55 55
 
56  
-	ret = cherokee_io_stat (REQ_SRV(conn)->iocache,
57  
-				&conn->local_directory,
58  
-				(REQ_SRV(conn)->iocache != NULL),
  56
+	ret = cherokee_io_stat (REQ_SRV(req)->iocache,
  57
+				&req->local_directory,
  58
+				(REQ_SRV(req)->iocache != NULL),
59 59
 				&stat_mem, &io_entry, &info);
60 60
 
61 61
 	if (ret != ret_ok) {
@@ -79,14 +79,14 @@ _check_document_root (cherokee_request_t *conn)
79 79
 
80 80
 static ret_t
81 81
 _render_document_root (cherokee_generic_evhost_t *evhost,
82  
-		       cherokee_request_t     *conn)
  82
+		       cherokee_request_t        *req)
83 83
 {
84 84
 	ret_t ret;
85 85
 
86 86
 	/* Render the document root
87 87
 	 */
88 88
 	ret = cherokee_template_render (&evhost->tpl_document_root,
89  
-					&conn->local_directory, conn);
  89
+					&req->local_directory, req);
90 90
 	if (unlikely (ret != ret_ok))
91 91
 		return ret_error;
92 92
 
@@ -95,13 +95,13 @@ _render_document_root (cherokee_generic_evhost_t *evhost,
95 95
 
96 96
 	/* Check the Document Root
97 97
 	 */
98  
-	ret = _check_document_root (conn);
  98
+	ret = _check_document_root (req);
99 99