~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to proxy/http2/HttpConfig.cc

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 
 
3
  A brief file description
 
4
 
 
5
  @section license License
 
6
 
 
7
  Licensed to the Apache Software Foundation (ASF) under one
 
8
  or more contributor license agreements.  See the NOTICE file
 
9
  distributed with this work for additional information
 
10
  regarding copyright ownership.  The ASF licenses this file
 
11
  to you under the Apache License, Version 2.0 (the
 
12
  "License"); you may not use this file except in compliance
 
13
  with the License.  You may obtain a copy of the License at
 
14
 
 
15
      http://www.apache.org/licenses/LICENSE-2.0
 
16
 
 
17
  Unless required by applicable law or agreed to in writing, software
 
18
  distributed under the License is distributed on an "AS IS" BASIS,
 
19
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
20
  See the License for the specific language governing permissions and
 
21
  limitations under the License.
 
22
 */
 
23
 
 
24
#include "ink_config.h"
 
25
#include <ctype.h>
 
26
#include <string.h>
 
27
#include "HttpConfig.h"
 
28
#include "HTTP.h"
 
29
#include "ProcessManager.h"
 
30
#include "ProxyConfig.h"
 
31
#include "ICPProcessor.h"
 
32
#include "P_Net.h"
 
33
#include "P_RecUtils.h"
 
34
 
 
35
#ifndef min
 
36
#define         min(a,b)        ((a) < (b) ? (a) : (b))
 
37
#endif
 
38
#ifndef max
 
39
#define         max(a,b)        ((a) > (b) ? (a) : (b))
 
40
#endif
 
41
 
 
42
#define HttpEstablishStaticConfigStringAlloc(_ix,_n) \
 
43
  REC_EstablishStaticConfigStringAlloc(_ix,_n); \
 
44
  REC_RegisterConfigUpdateFunc(_n, http_config_cb, NULL)
 
45
 
 
46
#define HttpEstablishStaticConfigLongLong(_ix,_n) \
 
47
  REC_EstablishStaticConfigInteger(_ix,_n); \
 
48
  REC_RegisterConfigUpdateFunc(_n, http_config_cb, NULL)
 
49
 
 
50
#define HttpEstablishStaticConfigFloat(_ix,_n) \
 
51
  REC_EstablishStaticConfigFloat(_ix,_n); \
 
52
  REC_RegisterConfigUpdateFunc(_n, http_config_cb, NULL)
 
53
 
 
54
 
 
55
RecRawStatBlock *http_rsb;
 
56
#define HTTP_CLEAR_DYN_STAT(x) \
 
57
do { \
 
58
        RecSetRawStatSum(http_rsb, x, 0); \
 
59
        RecSetRawStatCount(http_rsb, x, 0); \
 
60
} while (0);
 
61
 
 
62
 
 
63
 
 
64
class HttpConfigCont:public Continuation
 
65
{
 
66
public:
 
67
  HttpConfigCont();
 
68
  int handle_event(int event, void *edata);
 
69
};
 
70
 
 
71
 
 
72
////////////////////////////////////////////////////////////////
 
73
//
 
74
//  static variables
 
75
//
 
76
////////////////////////////////////////////////////////////////
 
77
int HttpConfig::m_id = 0;
 
78
HttpConfigParams HttpConfig::m_master;
 
79
HttpUserAgent_RegxEntry *HttpConfig::user_agent_list = NULL;
 
80
 
 
81
static volatile int http_config_changes = 1;
 
82
static HttpConfigCont *http_config_cont = NULL;
 
83
 
 
84
 
 
85
HttpConfigCont::HttpConfigCont()
 
86
  : Continuation(new_ProxyMutex())
 
87
{
 
88
  SET_HANDLER(&HttpConfigCont::handle_event);
 
89
}
 
90
 
 
91
int
 
92
HttpConfigCont::handle_event(int event, void *edata)
 
93
{
 
94
  NOWARN_UNUSED(event);
 
95
  NOWARN_UNUSED(edata);
 
96
  if (ink_atomic_increment((int *) &http_config_changes, -1) == 1) {
 
97
    HttpConfig::reconfigure();
 
98
  }
 
99
  return 0;
 
100
}
 
101
 
 
102
 
 
103
static int
 
104
http_config_cb(const char *name, RecDataT data_type, RecData data, void *cookie)
 
105
{
 
106
  NOWARN_UNUSED(name);
 
107
  NOWARN_UNUSED(data_type);
 
108
  NOWARN_UNUSED(data);
 
109
  NOWARN_UNUSED(cookie);
 
110
  ink_atomic_increment((int *) &http_config_changes, 1);
 
111
 
 
112
  INK_MEMORY_BARRIER;
 
113
 
 
114
  eventProcessor.schedule_in(http_config_cont, HRTIME_SECONDS(1), ET_CALL);
 
115
  return 0;
 
116
}
 
117
 
 
118
 
 
119
void
 
120
register_configs()
 
121
{
 
122
}
 
123
 
 
124
void
 
125
register_stat_callbacks()
 
126
{
 
127
 
 
128
  // Dynamic stats
 
129
 
 
130
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
131
                     "proxy.process.http.background_fill_current_count",
 
132
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_background_fill_current_count_stat, RecRawStatSyncSum);
 
133
  HTTP_CLEAR_DYN_STAT(http_background_fill_current_count_stat);
 
134
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
135
                     "proxy.process.http.current_client_connections",
 
136
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_client_connections_stat, RecRawStatSyncSum);
 
137
  HTTP_CLEAR_DYN_STAT(http_current_client_connections_stat);
 
138
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
139
                     "proxy.process.http.current_active_client_connections",
 
140
                     RECD_INT, RECP_NON_PERSISTENT,
 
141
                     (int) http_current_active_client_connections_stat, RecRawStatSyncSum);
 
142
  HTTP_CLEAR_DYN_STAT(http_current_active_client_connections_stat);
 
143
  // Current Transaction Stats
 
144
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
145
                     "proxy.process.http.current_client_transactions",
 
146
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_client_transactions_stat, RecRawStatSyncSum);
 
147
  HTTP_CLEAR_DYN_STAT(http_current_client_transactions_stat);
 
148
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
149
                     "proxy.process.http.current_parent_proxy_transactions",
 
150
                     RECD_INT, RECP_NON_PERSISTENT,
 
151
                     (int) http_current_parent_proxy_transactions_stat, RecRawStatSyncSum);
 
152
  HTTP_CLEAR_DYN_STAT(http_current_parent_proxy_transactions_stat);
 
153
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
154
                     "proxy.process.http.current_icp_transactions",
 
155
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_icp_transactions_stat, RecRawStatSyncSum);
 
156
  HTTP_CLEAR_DYN_STAT(http_current_icp_transactions_stat);
 
157
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
158
                     "proxy.process.http.current_server_transactions",
 
159
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_server_transactions_stat, RecRawStatSyncSum);
 
160
  HTTP_CLEAR_DYN_STAT(http_current_server_transactions_stat);
 
161
  // Current Transaction (Raw) Stats
 
162
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
163
                     "proxy.process.http.current_parent_proxy_raw_transactions",
 
164
                     RECD_INT, RECP_NON_PERSISTENT,
 
165
                     (int) http_current_parent_proxy_raw_transactions_stat, RecRawStatSyncSum);
 
166
  HTTP_CLEAR_DYN_STAT(http_current_parent_proxy_raw_transactions_stat);
 
167
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
168
                     "proxy.process.http.current_icp_raw_transactions",
 
169
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_icp_raw_transactions_stat, RecRawStatSyncSum);
 
170
  HTTP_CLEAR_DYN_STAT(http_current_icp_raw_transactions_stat);
 
171
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
172
                     "proxy.process.http.current_server_raw_transactions",
 
173
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_server_raw_transactions_stat, RecRawStatSyncSum);
 
174
  HTTP_CLEAR_DYN_STAT(http_current_server_raw_transactions_stat);
 
175
  // Total connections stats
 
176
 
 
177
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
178
                     "proxy.process.http.completed_requests",
 
179
                     RECD_COUNTER, RECP_NULL, (int) http_completed_requests_stat, RecRawStatSyncCount);
 
180
 
 
181
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
182
                     "proxy.process.http.total_incoming_connections",
 
183
                     RECD_COUNTER, RECP_NULL, (int) http_total_incoming_connections_stat, RecRawStatSyncCount);
 
184
 
 
185
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
186
                     "proxy.process.http.total_client_connections",
 
187
                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_stat, RecRawStatSyncCount);
 
188
 
 
189
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
190
                     "proxy.process.http.total_client_connections_ipv4",
 
191
                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_ipv4_stat, RecRawStatSyncCount);
 
192
 
 
193
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
194
                     "proxy.process.http.total_client_connections_ipv6",
 
195
                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_ipv6_stat, RecRawStatSyncCount);
 
196
 
 
197
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
198
                     "proxy.process.http.total_server_connections",
 
199
                     RECD_COUNTER, RECP_NULL, (int) http_total_server_connections_stat, RecRawStatSyncCount);
 
200
 
 
201
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
202
                     "proxy.process.http.total_parent_proxy_connections",
 
203
                     RECD_COUNTER, RECP_NULL, (int) http_total_parent_proxy_connections_stat, RecRawStatSyncCount);
 
204
 
 
205
  // Upstream current connections stats
 
206
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
207
                     "proxy.process.http.current_parent_proxy_connections",
 
208
                     RECD_INT, RECP_NON_PERSISTENT,
 
209
                     (int) http_current_parent_proxy_connections_stat, RecRawStatSyncSum);
 
210
  HTTP_CLEAR_DYN_STAT(http_current_parent_proxy_connections_stat);
 
211
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
212
                     "proxy.process.http.current_server_connections",
 
213
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_server_connections_stat, RecRawStatSyncSum);
 
214
  HTTP_CLEAR_DYN_STAT(http_current_server_connections_stat);
 
215
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
216
                     "proxy.process.http.current_cache_connections",
 
217
                     RECD_INT, RECP_NON_PERSISTENT, (int) http_current_cache_connections_stat, RecRawStatSyncSum);
 
218
  HTTP_CLEAR_DYN_STAT(http_current_cache_connections_stat);
 
219
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
220
                     "proxy.process.http.avg_transactions_per_client_connection",
 
221
                     RECD_FLOAT, RECP_NULL, (int) http_transactions_per_client_con, RecRawStatSyncAvg);
 
222
 
 
223
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
224
                     "proxy.process.http.avg_transactions_per_server_connection",
 
225
                     RECD_FLOAT, RECP_NULL, (int) http_transactions_per_server_con, RecRawStatSyncAvg);
 
226
 
 
227
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
228
                     "proxy.process.http.avg_transactions_per_parent_connection",
 
229
                     RECD_FLOAT, RECP_NULL, (int) http_transactions_per_parent_con, RecRawStatSyncAvg);
 
230
 
 
231
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
232
                     "proxy.process.http.client_connection_time",
 
233
                     RECD_INT, RECP_NULL, (int) http_client_connection_time_stat, RecRawStatSyncSum);
 
234
 
 
235
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
236
                     "proxy.process.http.parent_proxy_connection_time",
 
237
                     RECD_INT, RECP_NULL, (int) http_parent_proxy_connection_time_stat, RecRawStatSyncSum);
 
238
 
 
239
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
240
                     "proxy.process.http.server_connection_time",
 
241
                     RECD_INT, RECP_NULL, (int) http_server_connection_time_stat, RecRawStatSyncSum);
 
242
 
 
243
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
244
                     "proxy.process.http.cache_connection_time",
 
245
                     RECD_INT, RECP_NULL, (int) http_cache_connection_time_stat, RecRawStatSyncSum);
 
246
 
 
247
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
248
                     "proxy.process.http.transaction_counts.errors.pre_accept_hangups",
 
249
                     RECD_COUNTER, RECP_NULL,
 
250
                     (int) http_ua_msecs_counts_errors_pre_accept_hangups_stat, RecRawStatSyncCount);
 
251
 
 
252
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
253
                     "proxy.process.http.transaction_totaltime.errors.pre_accept_hangups",
 
254
                     RECD_FLOAT, RECP_NULL,
 
255
                     (int) http_ua_msecs_counts_errors_pre_accept_hangups_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
256
 
 
257
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
258
                     "proxy.process.http.transaction_counts.errors.empty_hangups",
 
259
                     RECD_COUNTER, RECP_NULL,
 
260
                     (int) http_ua_msecs_counts_errors_empty_hangups_stat, RecRawStatSyncCount);
 
261
 
 
262
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
263
                     "proxy.process.http.transaction_totaltime.errors.empty_hangups",
 
264
                     RECD_FLOAT, RECP_NULL, (int) http_ua_msecs_counts_errors_empty_hangups_stat, RecRawStatSyncCount);
 
265
 
 
266
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
267
                     "proxy.process.http.transaction_counts.errors.early_hangups",
 
268
                     RECD_COUNTER, RECP_NULL,
 
269
                     (int) http_ua_msecs_counts_errors_early_hangups_stat, RecRawStatSyncCount);
 
270
 
 
271
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
272
                     "proxy.process.http.transaction_totaltime.errors.early_hangups",
 
273
                     RECD_FLOAT, RECP_NULL, (int) http_ua_msecs_counts_errors_early_hangups_stat, RecRawStatSyncCount);
 
274
 
 
275
 
 
276
 
 
277
  // Transactional stats
 
278
 
 
279
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
280
                     "proxy.process.http.incoming_requests",
 
281
                     RECD_COUNTER, RECP_NULL, (int) http_incoming_requests_stat, RecRawStatSyncCount);
 
282
 
 
283
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
284
                     "proxy.process.http.outgoing_requests",
 
285
                     RECD_COUNTER, RECP_NULL, (int) http_outgoing_requests_stat, RecRawStatSyncCount);
 
286
 
 
287
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
288
                     "proxy.process.http.incoming_responses",
 
289
                     RECD_COUNTER, RECP_NULL, (int) http_incoming_responses_stat, RecRawStatSyncCount);
 
290
 
 
291
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
292
                     "proxy.process.http.invalid_client_requests",
 
293
                     RECD_COUNTER, RECP_NULL, (int) http_invalid_client_requests_stat, RecRawStatSyncCount);
 
294
 
 
295
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
296
                     "proxy.process.http.missing_host_hdr",
 
297
                     RECD_COUNTER, RECP_NULL, (int) http_missing_host_hdr_stat, RecRawStatSyncCount);
 
298
 
 
299
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
300
                     "proxy.process.http.get_requests",
 
301
                     RECD_COUNTER, RECP_NULL, (int) http_get_requests_stat, RecRawStatSyncCount);
 
302
 
 
303
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
304
                     "proxy.process.http.head_requests",
 
305
                     RECD_COUNTER, RECP_NULL, (int) http_head_requests_stat, RecRawStatSyncCount);
 
306
 
 
307
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
308
                     "proxy.process.http.trace_requests",
 
309
                     RECD_COUNTER, RECP_NULL, (int) http_trace_requests_stat, RecRawStatSyncCount);
 
310
 
 
311
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
312
                     "proxy.process.http.options_requests",
 
313
                     RECD_COUNTER, RECP_NULL, (int) http_options_requests_stat, RecRawStatSyncCount);
 
314
 
 
315
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
316
                     "proxy.process.http.post_requests",
 
317
                     RECD_COUNTER, RECP_NULL, (int) http_post_requests_stat, RecRawStatSyncCount);
 
318
 
 
319
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
320
                     "proxy.process.http.put_requests",
 
321
                     RECD_COUNTER, RECP_NULL, (int) http_put_requests_stat, RecRawStatSyncCount);
 
322
 
 
323
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
324
                     "proxy.process.http.push_requests",
 
325
                     RECD_COUNTER, RECP_NULL, (int) http_push_requests_stat, RecRawStatSyncCount);
 
326
 
 
327
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
328
                     "proxy.process.http.delete_requests",
 
329
                     RECD_COUNTER, RECP_NULL, (int) http_delete_requests_stat, RecRawStatSyncCount);
 
330
 
 
331
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
332
                     "proxy.process.http.purge_requests",
 
333
                     RECD_COUNTER, RECP_NULL, (int) http_purge_requests_stat, RecRawStatSyncCount);
 
334
 
 
335
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
336
                     "proxy.process.http.connect_requests",
 
337
                     RECD_COUNTER, RECP_NULL, (int) http_connect_requests_stat, RecRawStatSyncCount);
 
338
 
 
339
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
340
                     "proxy.process.http.extension_method_requests",
 
341
                     RECD_COUNTER, RECP_NULL, (int) http_extension_method_requests_stat, RecRawStatSyncCount);
 
342
 
 
343
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
344
                     "proxy.process.http.client_no_cache_requests",
 
345
                     RECD_COUNTER, RECP_NULL, (int) http_client_no_cache_requests_stat, RecRawStatSyncCount);
 
346
 
 
347
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
348
                     "proxy.process.http.broken_server_connections",
 
349
                     RECD_COUNTER, RECP_NULL, (int) http_broken_server_connections_stat, RecRawStatSyncCount);
 
350
 
 
351
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
352
                     "proxy.process.http.cache_lookups",
 
353
                     RECD_COUNTER, RECP_NULL, (int) http_cache_lookups_stat, RecRawStatSyncCount);
 
354
 
 
355
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
356
                     "proxy.process.http.cache_writes",
 
357
                     RECD_COUNTER, RECP_NULL, (int) http_cache_writes_stat, RecRawStatSyncCount);
 
358
 
 
359
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
360
                     "proxy.process.http.cache_updates",
 
361
                     RECD_COUNTER, RECP_NULL, (int) http_cache_updates_stat, RecRawStatSyncCount);
 
362
 
 
363
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
364
                     "proxy.process.http.cache_deletes",
 
365
                     RECD_COUNTER, RECP_NULL, (int) http_cache_deletes_stat, RecRawStatSyncCount);
 
366
 
 
367
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
368
                     "proxy.process.http.tunnels",
 
369
                     RECD_COUNTER, RECP_NULL, (int) http_tunnels_stat, RecRawStatSyncCount);
 
370
 
 
371
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
372
                     "proxy.process.http.throttled_proxy_only",
 
373
                     RECD_COUNTER, RECP_NULL, (int) http_throttled_proxy_only_stat, RecRawStatSyncCount);
 
374
 
 
375
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
376
                     "proxy.process.http.request_taxonomy.i0_n0_m0",
 
377
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n0_m0_stat, RecRawStatSyncCount);
 
378
 
 
379
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
380
                     "proxy.process.http.request_taxonomy.i1_n0_m0",
 
381
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n0_m0_stat, RecRawStatSyncCount);
 
382
 
 
383
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
384
                     "proxy.process.http.request_taxonomy.i0_n1_m0",
 
385
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n1_m0_stat, RecRawStatSyncCount);
 
386
 
 
387
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
388
                     "proxy.process.http.request_taxonomy.i1_n1_m0",
 
389
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n1_m0_stat, RecRawStatSyncCount);
 
390
 
 
391
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
392
                     "proxy.process.http.request_taxonomy.i0_n0_m1",
 
393
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n0_m1_stat, RecRawStatSyncCount);
 
394
 
 
395
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
396
                     "proxy.process.http.request_taxonomy.i1_n0_m1",
 
397
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n0_m1_stat, RecRawStatSyncCount);
 
398
 
 
399
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
400
                     "proxy.process.http.request_taxonomy.i0_n1_m1",
 
401
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n1_m1_stat, RecRawStatSyncCount);
 
402
 
 
403
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
404
                     "proxy.process.http.request_taxonomy.i1_n1_m1",
 
405
                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n1_m1_stat, RecRawStatSyncCount);
 
406
 
 
407
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
408
                     "proxy.process.http.icp_suggested_lookups",
 
409
                     RECD_COUNTER, RECP_NULL, (int) http_icp_suggested_lookups_stat, RecRawStatSyncCount);
 
410
 
 
411
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
412
                     "proxy.process.http.client_transaction_time",
 
413
                     RECD_INT, RECP_NULL, (int) http_client_transaction_time_stat, RecRawStatSyncSum);
 
414
 
 
415
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
416
                     "proxy.process.http.client_write_time",
 
417
                     RECD_INT, RECP_NULL, (int) http_client_write_time_stat, RecRawStatSyncSum);
 
418
 
 
419
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
420
                     "proxy.process.http.server_read_time",
 
421
                     RECD_INT, RECP_NULL, (int) http_server_read_time_stat, RecRawStatSyncSum);
 
422
 
 
423
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
424
                     "proxy.process.http.icp_transaction_time",
 
425
                     RECD_INT, RECP_NULL, (int) http_icp_transaction_time_stat, RecRawStatSyncSum);
 
426
 
 
427
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
428
                     "proxy.process.http.icp_raw_transaction_time",
 
429
                     RECD_INT, RECP_NULL, (int) http_icp_raw_transaction_time_stat, RecRawStatSyncSum);
 
430
 
 
431
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
432
                     "proxy.process.http.parent_proxy_transaction_time",
 
433
                     RECD_INT, RECP_NULL, (int) http_parent_proxy_transaction_time_stat, RecRawStatSyncSum);
 
434
 
 
435
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
436
                     "proxy.process.http.parent_proxy_raw_transaction_time",
 
437
                     RECD_INT, RECP_NULL, (int) http_parent_proxy_raw_transaction_time_stat, RecRawStatSyncSum);
 
438
 
 
439
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
440
                     "proxy.process.http.server_transaction_time",
 
441
                     RECD_INT, RECP_NULL, (int) http_server_transaction_time_stat, RecRawStatSyncSum);
 
442
 
 
443
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
444
                     "proxy.process.http.server_raw_transaction_time",
 
445
                     RECD_INT, RECP_NULL, (int) http_server_raw_transaction_time_stat, RecRawStatSyncSum);
 
446
 
 
447
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
448
                     "proxy.process.http.user_agent_request_header_total_size",
 
449
                     RECD_INT, RECP_NULL, (int) http_user_agent_request_header_total_size_stat, RecRawStatSyncSum);
 
450
 
 
451
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
452
                     "proxy.process.http.user_agent_response_header_total_size",
 
453
                     RECD_INT, RECP_NULL, (int) http_user_agent_response_header_total_size_stat, RecRawStatSyncSum);
 
454
 
 
455
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
456
                     "proxy.process.http.user_agent_request_document_total_size",
 
457
                     RECD_INT, RECP_NULL, (int) http_user_agent_request_document_total_size_stat, RecRawStatSyncSum);
 
458
 
 
459
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
460
                     "proxy.process.http.user_agent_response_document_total_size",
 
461
                     RECD_INT, RECP_NULL, (int) http_user_agent_response_document_total_size_stat, RecRawStatSyncSum);
 
462
 
 
463
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
464
                     "proxy.process.http.origin_server_request_header_total_size",
 
465
                     RECD_INT, RECP_NULL, (int) http_origin_server_request_header_total_size_stat, RecRawStatSyncSum);
 
466
 
 
467
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
468
                     "proxy.process.http.origin_server_response_header_total_size",
 
469
                     RECD_INT, RECP_NULL, (int) http_origin_server_response_header_total_size_stat, RecRawStatSyncSum);
 
470
 
 
471
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
472
                     "proxy.process.http.origin_server_request_document_total_size",
 
473
                     RECD_INT, RECP_NULL, (int) http_origin_server_request_document_total_size_stat, RecRawStatSyncSum);
 
474
 
 
475
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
476
                     "proxy.process.http.origin_server_response_document_total_size",
 
477
                     RECD_INT, RECP_NULL,
 
478
                     (int) http_origin_server_response_document_total_size_stat, RecRawStatSyncSum);
 
479
 
 
480
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
481
                     "proxy.process.http.parent_proxy_request_total_bytes",
 
482
                     RECD_INT, RECP_NULL, (int) http_parent_proxy_request_total_bytes_stat, RecRawStatSyncSum);
 
483
 
 
484
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
485
                     "proxy.process.http.parent_proxy_response_total_bytes",
 
486
                     RECD_INT, RECP_NULL, (int) http_parent_proxy_response_total_bytes_stat, RecRawStatSyncSum);
 
487
 
 
488
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
489
                     "proxy.process.http.pushed_response_header_total_size",
 
490
                     RECD_INT, RECP_NULL, (int) http_pushed_response_header_total_size_stat, RecRawStatSyncSum);
 
491
 
 
492
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
493
                     "proxy.process.http.pushed_document_total_size",
 
494
                     RECD_INT, RECP_NULL, (int) http_pushed_document_total_size_stat, RecRawStatSyncSum);
 
495
 
 
496
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
497
                     "proxy.process.http.response_document_size_100",
 
498
                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_100_stat, RecRawStatSyncCount);
 
499
 
 
500
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
501
                     "proxy.process.http.response_document_size_1K",
 
502
                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_1K_stat, RecRawStatSyncCount);
 
503
 
 
504
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
505
                     "proxy.process.http.response_document_size_3K",
 
506
                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_3K_stat, RecRawStatSyncCount);
 
507
 
 
508
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
509
                     "proxy.process.http.response_document_size_5K",
 
510
                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_5K_stat, RecRawStatSyncCount);
 
511
 
 
512
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
513
                     "proxy.process.http.response_document_size_10K",
 
514
                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_10K_stat, RecRawStatSyncCount);
 
515
 
 
516
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
517
                     "proxy.process.http.response_document_size_1M",
 
518
                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_1M_stat, RecRawStatSyncCount);
 
519
 
 
520
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
521
                     "proxy.process.http.response_document_size_inf",
 
522
                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_inf_stat, RecRawStatSyncCount);
 
523
 
 
524
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
525
                     "proxy.process.http.request_document_size_100",
 
526
                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_100_stat, RecRawStatSyncCount);
 
527
 
 
528
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
529
                     "proxy.process.http.request_document_size_1K",
 
530
                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_1K_stat, RecRawStatSyncCount);
 
531
 
 
532
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
533
                     "proxy.process.http.request_document_size_3K",
 
534
                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_3K_stat, RecRawStatSyncCount);
 
535
 
 
536
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
537
                     "proxy.process.http.request_document_size_5K",
 
538
                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_5K_stat, RecRawStatSyncCount);
 
539
 
 
540
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
541
                     "proxy.process.http.request_document_size_10K",
 
542
                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_10K_stat, RecRawStatSyncCount);
 
543
 
 
544
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
545
                     "proxy.process.http.request_document_size_1M",
 
546
                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_1M_stat, RecRawStatSyncCount);
 
547
 
 
548
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
549
                     "proxy.process.http.request_document_size_inf",
 
550
                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_inf_stat, RecRawStatSyncCount);
 
551
 
 
552
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
553
                     "proxy.process.http.user_agent_speed_bytes_per_sec_100",
 
554
                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_100_stat, RecRawStatSyncCount);
 
555
 
 
556
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
557
                     "proxy.process.http.user_agent_speed_bytes_per_sec_1K",
 
558
                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_1K_stat, RecRawStatSyncCount);
 
559
 
 
560
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
561
                     "proxy.process.http.user_agent_speed_bytes_per_sec_10K",
 
562
                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_10K_stat, RecRawStatSyncCount);
 
563
 
 
564
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
565
                     "proxy.process.http.user_agent_speed_bytes_per_sec_100K",
 
566
                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_100K_stat, RecRawStatSyncCount);
 
567
 
 
568
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
569
                     "proxy.process.http.user_agent_speed_bytes_per_sec_1M",
 
570
                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_1M_stat, RecRawStatSyncCount);
 
571
 
 
572
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
573
                     "proxy.process.http.user_agent_speed_bytes_per_sec_10M",
 
574
                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_10M_stat, RecRawStatSyncCount);
 
575
 
 
576
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
577
                     "proxy.process.http.user_agent_speed_bytes_per_sec_100M",
 
578
                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_100M_stat, RecRawStatSyncCount);
 
579
 
 
580
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
581
                     "proxy.process.http.origin_server_speed_bytes_per_sec_100",
 
582
                     RECD_COUNTER, RECP_NULL,
 
583
                     (int) http_origin_server_speed_bytes_per_sec_100_stat, RecRawStatSyncCount);
 
584
 
 
585
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
586
                     "proxy.process.http.origin_server_speed_bytes_per_sec_1K",
 
587
                     RECD_COUNTER, RECP_NULL,
 
588
                     (int) http_origin_server_speed_bytes_per_sec_1K_stat, RecRawStatSyncCount);
 
589
 
 
590
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
591
                     "proxy.process.http.origin_server_speed_bytes_per_sec_10K",
 
592
                     RECD_COUNTER, RECP_NULL,
 
593
                     (int) http_origin_server_speed_bytes_per_sec_10K_stat, RecRawStatSyncCount);
 
594
 
 
595
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
596
                     "proxy.process.http.origin_server_speed_bytes_per_sec_100K",
 
597
                     RECD_COUNTER, RECP_NULL,
 
598
                     (int) http_origin_server_speed_bytes_per_sec_100K_stat, RecRawStatSyncCount);
 
599
 
 
600
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
601
                     "proxy.process.http.origin_server_speed_bytes_per_sec_1M",
 
602
                     RECD_COUNTER, RECP_NULL,
 
603
                     (int) http_origin_server_speed_bytes_per_sec_1M_stat, RecRawStatSyncCount);
 
604
 
 
605
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
606
                     "proxy.process.http.origin_server_speed_bytes_per_sec_10M",
 
607
                     RECD_COUNTER, RECP_NULL,
 
608
                     (int) http_origin_server_speed_bytes_per_sec_10M_stat, RecRawStatSyncCount);
 
609
 
 
610
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
611
                     "proxy.process.http.origin_server_speed_bytes_per_sec_100M",
 
612
                     RECD_COUNTER, RECP_NULL,
 
613
                     (int) http_origin_server_speed_bytes_per_sec_100M_stat, RecRawStatSyncCount);
 
614
 
 
615
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
616
                     "proxy.process.http.total_transactions_time",
 
617
                     RECD_INT, RECP_NULL, (int) http_total_transactions_time_stat, RecRawStatSyncSum);
 
618
 
 
619
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
620
                     "proxy.process.http.total_transactions_think_time",
 
621
                     RECD_INT, RECP_NULL, (int) http_total_transactions_think_time_stat, RecRawStatSyncSum);
 
622
 
 
623
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
624
                     "proxy.process.http.cache_hit_fresh",
 
625
                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_fresh_stat, RecRawStatSyncCount);
 
626
 
 
627
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
628
                     "proxy.process.http.cache_hit_revalidated",
 
629
                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_reval_stat, RecRawStatSyncCount);
 
630
 
 
631
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
632
                     "proxy.process.http.cache_hit_ims",
 
633
                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_ims_stat, RecRawStatSyncCount);
 
634
 
 
635
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
636
                     "proxy.process.http.cache_hit_stale_served",
 
637
                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_stale_served_stat, RecRawStatSyncCount);
 
638
 
 
639
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
640
                     "proxy.process.http.cache_miss_cold",
 
641
                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_cold_stat, RecRawStatSyncCount);
 
642
 
 
643
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
644
                     "proxy.process.http.cache_miss_changed",
 
645
                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_changed_stat, RecRawStatSyncCount);
 
646
 
 
647
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
648
                     "proxy.process.http.cache_miss_client_no_cache",
 
649
                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_client_no_cache_stat, RecRawStatSyncCount);
 
650
 
 
651
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
652
                     "proxy.process.http.cache_miss_client_not_cacheable",
 
653
                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_uncacheable_stat, RecRawStatSyncCount);
 
654
 
 
655
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
656
                     "proxy.process.http.cache_miss_ims",
 
657
                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_ims_stat, RecRawStatSyncCount);
 
658
 
 
659
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
660
                     "proxy.process.http.cache_read_error",
 
661
                     RECD_COUNTER, RECP_NULL, (int) http_cache_read_error_stat, RecRawStatSyncCount);
 
662
 
 
663
  /////////////////////////////////////////
 
664
  // Bandwidth Savings Transaction Stats //
 
665
  /////////////////////////////////////////
 
666
 
 
667
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
668
                     "proxy.process.http.tcp_hit_count_stat",
 
669
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_hit_count_stat, RecRawStatSyncCount);
 
670
 
 
671
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
672
                     "proxy.process.http.tcp_hit_user_agent_bytes_stat",
 
673
                     RECD_INT, RECP_NULL, (int) http_tcp_hit_user_agent_bytes_stat, RecRawStatSyncSum);
 
674
 
 
675
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
676
                     "proxy.process.http.tcp_hit_origin_server_bytes_stat",
 
677
                     RECD_INT, RECP_NULL, (int) http_tcp_hit_origin_server_bytes_stat, RecRawStatSyncSum);
 
678
 
 
679
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
680
                     "proxy.process.http.tcp_miss_count_stat",
 
681
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_miss_count_stat, RecRawStatSyncCount);
 
682
 
 
683
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
684
                     "proxy.process.http.tcp_miss_user_agent_bytes_stat",
 
685
                     RECD_INT, RECP_NULL, (int) http_tcp_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
686
 
 
687
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
688
                     "proxy.process.http.tcp_miss_origin_server_bytes_stat",
 
689
                     RECD_INT, RECP_NULL, (int) http_tcp_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
690
 
 
691
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
692
                     "proxy.process.http.tcp_expired_miss_count_stat",
 
693
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_expired_miss_count_stat, RecRawStatSyncCount);
 
694
 
 
695
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
696
                     "proxy.process.http.tcp_expired_miss_user_agent_bytes_stat",
 
697
                     RECD_INT, RECP_NULL, (int) http_tcp_expired_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
698
 
 
699
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
700
                     "proxy.process.http.tcp_expired_miss_origin_server_bytes_stat",
 
701
                     RECD_INT, RECP_NULL, (int) http_tcp_expired_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
702
 
 
703
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
704
                     "proxy.process.http.tcp_refresh_hit_count_stat",
 
705
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_refresh_hit_count_stat, RecRawStatSyncCount);
 
706
 
 
707
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
708
                     "proxy.process.http.tcp_refresh_hit_user_agent_bytes_stat",
 
709
                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_hit_user_agent_bytes_stat, RecRawStatSyncSum);
 
710
 
 
711
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
712
                     "proxy.process.http.tcp_refresh_hit_origin_server_bytes_stat",
 
713
                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_hit_origin_server_bytes_stat, RecRawStatSyncSum);
 
714
 
 
715
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
716
                     "proxy.process.http.tcp_refresh_miss_count_stat",
 
717
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_refresh_miss_count_stat, RecRawStatSyncCount);
 
718
 
 
719
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
720
                     "proxy.process.http.tcp_refresh_miss_user_agent_bytes_stat",
 
721
                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
722
 
 
723
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
724
                     "proxy.process.http.tcp_refresh_miss_origin_server_bytes_stat",
 
725
                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
726
 
 
727
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
728
                     "proxy.process.http.tcp_client_refresh_count_stat",
 
729
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_client_refresh_count_stat, RecRawStatSyncCount);
 
730
 
 
731
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
732
                     "proxy.process.http.tcp_client_refresh_user_agent_bytes_stat",
 
733
                     RECD_INT, RECP_NULL, (int) http_tcp_client_refresh_user_agent_bytes_stat, RecRawStatSyncSum);
 
734
 
 
735
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
736
                     "proxy.process.http.tcp_client_refresh_origin_server_bytes_stat",
 
737
                     RECD_INT, RECP_NULL, (int) http_tcp_client_refresh_origin_server_bytes_stat, RecRawStatSyncSum);
 
738
 
 
739
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
740
                     "proxy.process.http.tcp_ims_hit_count_stat",
 
741
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_ims_hit_count_stat, RecRawStatSyncCount);
 
742
 
 
743
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
744
                     "proxy.process.http.tcp_ims_hit_user_agent_bytes_stat",
 
745
                     RECD_INT, RECP_NULL, (int) http_tcp_ims_hit_user_agent_bytes_stat, RecRawStatSyncSum);
 
746
 
 
747
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
748
                     "proxy.process.http.tcp_ims_hit_origin_server_bytes_stat",
 
749
                     RECD_INT, RECP_NULL, (int) http_tcp_ims_hit_origin_server_bytes_stat, RecRawStatSyncSum);
 
750
 
 
751
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
752
                     "proxy.process.http.tcp_ims_miss_count_stat",
 
753
                     RECD_COUNTER, RECP_NULL, (int) http_tcp_ims_miss_count_stat, RecRawStatSyncCount);
 
754
 
 
755
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
756
                     "proxy.process.http.tcp_ims_miss_user_agent_bytes_stat",
 
757
                     RECD_INT, RECP_NULL, (int) http_tcp_ims_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
758
 
 
759
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
760
                     "proxy.process.http.tcp_ims_miss_origin_server_bytes_stat",
 
761
                     RECD_INT, RECP_NULL, (int) http_tcp_ims_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
762
 
 
763
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
764
                     "proxy.process.http.err_client_abort_count_stat",
 
765
                     RECD_COUNTER, RECP_NULL, (int) http_err_client_abort_count_stat, RecRawStatSyncCount);
 
766
 
 
767
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
768
                     "proxy.process.http.err_client_abort_user_agent_bytes_stat",
 
769
                     RECD_INT, RECP_NULL, (int) http_err_client_abort_user_agent_bytes_stat, RecRawStatSyncSum);
 
770
 
 
771
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
772
                     "proxy.process.http.err_client_abort_origin_server_bytes_stat",
 
773
                     RECD_INT, RECP_NULL, (int) http_err_client_abort_origin_server_bytes_stat, RecRawStatSyncSum);
 
774
 
 
775
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
776
                     "proxy.process.http.err_connect_fail_count_stat",
 
777
                     RECD_COUNTER, RECP_NULL, (int) http_err_connect_fail_count_stat, RecRawStatSyncCount);
 
778
 
 
779
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
780
                     "proxy.process.http.err_connect_fail_user_agent_bytes_stat",
 
781
                     RECD_INT, RECP_NULL, (int) http_err_connect_fail_user_agent_bytes_stat, RecRawStatSyncSum);
 
782
 
 
783
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
784
                     "proxy.process.http.err_connect_fail_origin_server_bytes_stat",
 
785
                     RECD_INT, RECP_NULL, (int) http_err_connect_fail_origin_server_bytes_stat, RecRawStatSyncSum);
 
786
 
 
787
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
788
                     "proxy.process.http.misc_count_stat",
 
789
                     RECD_COUNTER, RECP_NULL, (int) http_misc_count_stat, RecRawStatSyncCount);
 
790
 
 
791
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
792
                     "proxy.process.http.misc_user_agent_bytes_stat",
 
793
                     RECD_INT, RECP_NULL, (int) http_misc_user_agent_bytes_stat, RecRawStatSyncSum);
 
794
 
 
795
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
796
                     "proxy.process.http.background_fill_bytes_aborted_stat",
 
797
                     RECD_INT, RECP_NULL, (int) http_background_fill_bytes_aborted_stat, RecRawStatSyncSum);
 
798
 
 
799
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
800
                     "proxy.process.http.background_fill_bytes_completed_stat",
 
801
                     RECD_INT, RECP_NULL, (int) http_background_fill_bytes_completed_stat, RecRawStatSyncSum);
 
802
 
 
803
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
804
                     "proxy.process.http.cache_write_errors",
 
805
                     RECD_INT, RECP_NULL, (int) http_cache_write_errors, RecRawStatSyncSum);
 
806
 
 
807
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
808
                     "proxy.process.http.cache_read_errors",
 
809
                     RECD_INT, RECP_NULL, (int) http_cache_read_errors, RecRawStatSyncSum);
 
810
 
 
811
  ////////////////////////////////////////////////////////////////////////////////
 
812
  // status code counts
 
813
  ////////////////////////////////////////////////////////////////////////////////
 
814
 
 
815
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
816
                     "proxy.process.http.100_responses",
 
817
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_100_count_stat, RecRawStatSyncCount);
 
818
 
 
819
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
820
                     "proxy.process.http.101_responses",
 
821
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_101_count_stat, RecRawStatSyncCount);
 
822
 
 
823
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
824
                     "proxy.process.http.1xx_responses",
 
825
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_1xx_count_stat, RecRawStatSyncCount);
 
826
 
 
827
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
828
                     "proxy.process.http.200_responses",
 
829
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_200_count_stat, RecRawStatSyncCount);
 
830
 
 
831
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
832
                     "proxy.process.http.201_responses",
 
833
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_201_count_stat, RecRawStatSyncCount);
 
834
 
 
835
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
836
                     "proxy.process.http.202_responses",
 
837
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_202_count_stat, RecRawStatSyncCount);
 
838
 
 
839
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
840
                     "proxy.process.http.203_responses",
 
841
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_203_count_stat, RecRawStatSyncCount);
 
842
 
 
843
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
844
                     "proxy.process.http.204_responses",
 
845
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_204_count_stat, RecRawStatSyncCount);
 
846
 
 
847
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
848
                     "proxy.process.http.205_responses",
 
849
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_205_count_stat, RecRawStatSyncCount);
 
850
 
 
851
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
852
                     "proxy.process.http.206_responses",
 
853
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_206_count_stat, RecRawStatSyncCount);
 
854
 
 
855
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
856
                     "proxy.process.http.2xx_responses",
 
857
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_2xx_count_stat, RecRawStatSyncCount);
 
858
 
 
859
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
860
                     "proxy.process.http.300_responses",
 
861
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_300_count_stat, RecRawStatSyncCount);
 
862
 
 
863
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
864
                     "proxy.process.http.301_responses",
 
865
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_301_count_stat, RecRawStatSyncCount);
 
866
 
 
867
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
868
                     "proxy.process.http.302_responses",
 
869
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_302_count_stat, RecRawStatSyncCount);
 
870
 
 
871
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
872
                     "proxy.process.http.303_responses",
 
873
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_303_count_stat, RecRawStatSyncCount);
 
874
 
 
875
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
876
                     "proxy.process.http.304_responses",
 
877
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_304_count_stat, RecRawStatSyncCount);
 
878
 
 
879
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
880
                     "proxy.process.http.305_responses",
 
881
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_305_count_stat, RecRawStatSyncCount);
 
882
 
 
883
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
884
                     "proxy.process.http.307_responses",
 
885
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_307_count_stat, RecRawStatSyncCount);
 
886
 
 
887
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
888
                     "proxy.process.http.3xx_responses",
 
889
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_3xx_count_stat, RecRawStatSyncCount);
 
890
 
 
891
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
892
                     "proxy.process.http.400_responses",
 
893
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_400_count_stat, RecRawStatSyncCount);
 
894
 
 
895
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
896
                     "proxy.process.http.401_responses",
 
897
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_401_count_stat, RecRawStatSyncCount);
 
898
 
 
899
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
900
                     "proxy.process.http.402_responses",
 
901
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_402_count_stat, RecRawStatSyncCount);
 
902
 
 
903
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
904
                     "proxy.process.http.403_responses",
 
905
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_403_count_stat, RecRawStatSyncCount);
 
906
 
 
907
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
908
                     "proxy.process.http.404_responses",
 
909
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_404_count_stat, RecRawStatSyncCount);
 
910
 
 
911
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
912
                     "proxy.process.http.405_responses",
 
913
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_405_count_stat, RecRawStatSyncCount);
 
914
 
 
915
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
916
                     "proxy.process.http.406_responses",
 
917
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_406_count_stat, RecRawStatSyncCount);
 
918
 
 
919
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
920
                     "proxy.process.http.407_responses",
 
921
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_407_count_stat, RecRawStatSyncCount);
 
922
 
 
923
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
924
                     "proxy.process.http.408_responses",
 
925
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_408_count_stat, RecRawStatSyncCount);
 
926
 
 
927
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
928
                     "proxy.process.http.409_responses",
 
929
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_409_count_stat, RecRawStatSyncCount);
 
930
 
 
931
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
932
                     "proxy.process.http.410_responses",
 
933
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_410_count_stat, RecRawStatSyncCount);
 
934
 
 
935
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
936
                     "proxy.process.http.411_responses",
 
937
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_411_count_stat, RecRawStatSyncCount);
 
938
 
 
939
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
940
                     "proxy.process.http.412_responses",
 
941
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_412_count_stat, RecRawStatSyncCount);
 
942
 
 
943
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
944
                     "proxy.process.http.413_responses",
 
945
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_413_count_stat, RecRawStatSyncCount);
 
946
 
 
947
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
948
                     "proxy.process.http.414_responses",
 
949
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_414_count_stat, RecRawStatSyncCount);
 
950
 
 
951
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
952
                     "proxy.process.http.415_responses",
 
953
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_415_count_stat, RecRawStatSyncCount);
 
954
 
 
955
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
956
                     "proxy.process.http.416_responses",
 
957
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_416_count_stat, RecRawStatSyncCount);
 
958
 
 
959
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
960
                     "proxy.process.http.4xx_responses",
 
961
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_4xx_count_stat, RecRawStatSyncCount);
 
962
 
 
963
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
964
                     "proxy.process.http.500_responses",
 
965
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_500_count_stat, RecRawStatSyncCount);
 
966
 
 
967
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
968
                     "proxy.process.http.501_responses",
 
969
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_501_count_stat, RecRawStatSyncCount);
 
970
 
 
971
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
972
                     "proxy.process.http.502_responses",
 
973
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_502_count_stat, RecRawStatSyncCount);
 
974
 
 
975
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
976
                     "proxy.process.http.503_responses",
 
977
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_503_count_stat, RecRawStatSyncCount);
 
978
 
 
979
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
980
                     "proxy.process.http.504_responses",
 
981
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_504_count_stat, RecRawStatSyncCount);
 
982
 
 
983
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
984
                     "proxy.process.http.505_responses",
 
985
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_505_count_stat, RecRawStatSyncCount);
 
986
 
 
987
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
988
                     "proxy.process.http.5xx_responses",
 
989
                     RECD_COUNTER, RECP_NULL, (int) http_response_status_5xx_count_stat, RecRawStatSyncCount);
 
990
 
 
991
 
 
992
  ////////////////////////////////////////////////////////////////////////////////
 
993
  // http - time and count of transactions classified by client's point of view //
 
994
  //  the internal stat is in msecs, the output time is float seconds           //
 
995
  ////////////////////////////////////////////////////////////////////////////////
 
996
 
 
997
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
998
                     "proxy.process.http.transaction_counts.hit_fresh",
 
999
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_hit_fresh_stat, RecRawStatSyncCount);
 
1000
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1001
                     "proxy.process.http.transaction_totaltime.hit_fresh",
 
1002
                     RECD_FLOAT, RECP_NULL,
 
1003
                     (int) http_ua_msecs_counts_hit_fresh_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1004
 
 
1005
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1006
                     "proxy.process.http.transaction_counts.hit_fresh.process",
 
1007
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_hit_fresh_process_stat, RecRawStatSyncCount);
 
1008
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1009
                     "proxy.process.http.transaction_totaltime.hit_fresh.process",
 
1010
                     RECD_FLOAT, RECP_NULL,
 
1011
                     (int) http_ua_msecs_counts_hit_fresh_process_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1012
 
 
1013
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1014
                     "proxy.process.http.transaction_counts.hit_revalidated",
 
1015
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_hit_reval_stat, RecRawStatSyncCount);
 
1016
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1017
                     "proxy.process.http.transaction_totaltime.hit_revalidated",
 
1018
                     RECD_FLOAT, RECP_NULL,
 
1019
                     (int) http_ua_msecs_counts_hit_reval_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1020
 
 
1021
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1022
                     "proxy.process.http.transaction_counts.miss_cold",
 
1023
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_miss_cold_stat, RecRawStatSyncCount);
 
1024
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1025
                     "proxy.process.http.transaction_totaltime.miss_cold",
 
1026
                     RECD_FLOAT, RECP_NULL,
 
1027
                     (int) http_ua_msecs_counts_miss_cold_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1028
 
 
1029
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1030
                     "proxy.process.http.transaction_counts.miss_not_cacheable",
 
1031
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_miss_uncacheable_stat, RecRawStatSyncCount);
 
1032
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1033
                     "proxy.process.http.transaction_totaltime.miss_not_cacheable",
 
1034
                     RECD_FLOAT, RECP_NULL,
 
1035
                     (int) http_ua_msecs_counts_miss_uncacheable_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1036
 
 
1037
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1038
                     "proxy.process.http.transaction_counts.miss_changed",
 
1039
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_miss_changed_stat, RecRawStatSyncCount);
 
1040
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1041
                     "proxy.process.http.transaction_totaltime.miss_changed",
 
1042
                     RECD_FLOAT, RECP_NULL,
 
1043
                     (int) http_ua_msecs_counts_miss_changed_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1044
 
 
1045
 
 
1046
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1047
                     "proxy.process.http.transaction_counts.miss_client_no_cache",
 
1048
                     RECD_COUNTER, RECP_NULL,
 
1049
                     (int) http_ua_msecs_counts_miss_client_no_cache_stat, RecRawStatSyncCount);
 
1050
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1051
                     "proxy.process.http.transaction_totaltime.miss_client_no_cache",
 
1052
                     RECD_FLOAT, RECP_NULL,
 
1053
                     (int) http_ua_msecs_counts_miss_client_no_cache_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1054
 
 
1055
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1056
                     "proxy.process.http.transaction_counts.errors.aborts",
 
1057
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_errors_aborts_stat, RecRawStatSyncCount);
 
1058
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1059
                     "proxy.process.http.transaction_totaltime.errors.aborts",
 
1060
                     RECD_FLOAT, RECP_NULL,
 
1061
                     (int) http_ua_msecs_counts_errors_aborts_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1062
 
 
1063
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1064
                     "proxy.process.http.transaction_counts.errors.possible_aborts",
 
1065
                     RECD_COUNTER, RECP_NULL,
 
1066
                     (int) http_ua_msecs_counts_errors_possible_aborts_stat, RecRawStatSyncCount);
 
1067
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1068
                     "proxy.process.http.transaction_totaltime.errors.possible_aborts",
 
1069
                     RECD_FLOAT, RECP_NULL,
 
1070
                     (int) http_ua_msecs_counts_errors_possible_aborts_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1071
 
 
1072
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1073
                     "proxy.process.http.transaction_counts.errors.connect_failed",
 
1074
                     RECD_COUNTER, RECP_NULL,
 
1075
                     (int) http_ua_msecs_counts_errors_connect_failed_stat, RecRawStatSyncCount);
 
1076
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1077
                     "proxy.process.http.transaction_totaltime.errors.connect_failed",
 
1078
                     RECD_FLOAT, RECP_NULL,
 
1079
                     (int) http_ua_msecs_counts_errors_connect_failed_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1080
 
 
1081
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1082
                     "proxy.process.http.transaction_counts.errors.other",
 
1083
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_errors_other_stat, RecRawStatSyncCount);
 
1084
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1085
                     "proxy.process.http.transaction_totaltime.errors.other",
 
1086
                     RECD_FLOAT, RECP_NULL,
 
1087
                     (int) http_ua_msecs_counts_errors_other_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1088
 
 
1089
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1090
                     "proxy.process.http.transaction_counts.other.unclassified",
 
1091
                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_other_unclassified_stat, RecRawStatSyncCount);
 
1092
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1093
                     "proxy.process.http.transaction_totaltime.other.unclassified",
 
1094
                     RECD_FLOAT, RECP_NULL,
 
1095
                     (int) http_ua_msecs_counts_other_unclassified_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
1096
 
 
1097
  RecRegisterRawStat(http_rsb, RECT_PROCESS,
 
1098
                     "proxy.process.http.total_x_redirect_count",
 
1099
                     RECD_COUNTER, RECP_NULL,
 
1100
                     (int) http_total_x_redirect_stat, RecRawStatSyncCount);
 
1101
 
 
1102
}
 
1103
 
 
1104
 
 
1105
////////////////////////////////////////////////////////////////
 
1106
//
 
1107
//  HttpConfig::startup()
 
1108
//
 
1109
////////////////////////////////////////////////////////////////
 
1110
void
 
1111
HttpConfig::startup()
 
1112
{
 
1113
 
 
1114
  http_rsb = RecAllocateRawStatBlock((int) http_stat_count);
 
1115
  register_configs();
 
1116
  register_stat_callbacks();
 
1117
 
 
1118
  HttpConfigParams &c = m_master;
 
1119
 
 
1120
  http_config_cont = NEW(new HttpConfigCont);
 
1121
 
 
1122
  HttpEstablishStaticConfigStringAlloc(c.proxy_hostname, "proxy.config.proxy_name");
 
1123
  c.proxy_hostname_len = -1;
 
1124
 
 
1125
  if (c.proxy_hostname == NULL) {
 
1126
    c.proxy_hostname = (char *) xmalloc(sizeof(char));
 
1127
    c.proxy_hostname[0] = '\0';
 
1128
  }
 
1129
 
 
1130
  RecGetRecordString_Xmalloc("proxy.local.incoming_ip_to_bind", &(c.incoming_ip_to_bind));
 
1131
 
 
1132
  if (c.incoming_ip_to_bind) {
 
1133
    Debug("ip_binding", "incoming_ip_to_bind: %s", c.incoming_ip_to_bind);
 
1134
    c.incoming_ip_to_bind_saddr = inet_addr(c.incoming_ip_to_bind);
 
1135
  }
 
1136
 
 
1137
  RecGetRecordString_Xmalloc("proxy.local.outgoing_ip_to_bind", &(c.outgoing_ip_to_bind));
 
1138
 
 
1139
  if (c.outgoing_ip_to_bind) {
 
1140
    Debug("ip_binding", "outgoing_ip_to_bind: %s", c.outgoing_ip_to_bind);
 
1141
    c.outgoing_ip_to_bind_saddr = inet_addr(c.outgoing_ip_to_bind);
 
1142
  }
 
1143
 
 
1144
  HttpEstablishStaticConfigLongLong(c.server_max_connections, "proxy.config.http.server_max_connections");
 
1145
 
 
1146
  HttpEstablishStaticConfigLongLong(c.oride.origin_max_connections, "proxy.config.http.origin_max_connections");
 
1147
 
 
1148
  HttpEstablishStaticConfigLongLong(c.origin_min_keep_alive_connections, "proxy.config.http.origin_min_keep_alive_connections");
 
1149
 
 
1150
  HttpEstablishStaticConfigLongLong(c.parent_proxy_routing_enable, "proxy.config.http.parent_proxy_routing_enable");
 
1151
 
 
1152
  // Wank me.
 
1153
  REC_ReadConfigInteger(c.disable_ssl_parenting, "proxy.local.http.parent_proxy.disable_connect_tunneling");
 
1154
  HttpEstablishStaticConfigLongLong(c.no_dns_forward_to_parent, "proxy.config.http.no_dns_just_forward_to_parent");
 
1155
  HttpEstablishStaticConfigLongLong(c.uncacheable_requests_bypass_parent,
 
1156
                                    "proxy.config.http.uncacheable_requests_bypass_parent");
 
1157
  HttpEstablishStaticConfigLongLong(c.no_origin_server_dns, "proxy.config.http.no_origin_server_dns");
 
1158
  HttpEstablishStaticConfigLongLong(c.use_client_target_addr, "proxy.config.http.use_client_target_addr");
 
1159
  HttpEstablishStaticConfigLongLong(c.oride.maintain_pristine_host_hdr, "proxy.config.url_remap.pristine_host_hdr");
 
1160
 
 
1161
  HttpEstablishStaticConfigLongLong(c.snarf_username_from_authorization,
 
1162
                                    "proxy.config.http.snarf_username_from_authorization");
 
1163
 
 
1164
  HttpEstablishStaticConfigLongLong(c.enable_url_expandomatic, "proxy.config.http.enable_url_expandomatic");
 
1165
 
 
1166
  HttpEstablishStaticConfigLongLong(c.oride.insert_request_via_string, "proxy.config.http.insert_request_via_str");
 
1167
  HttpEstablishStaticConfigLongLong(c.oride.insert_response_via_string, "proxy.config.http.insert_response_via_str");
 
1168
  HttpEstablishStaticConfigLongLong(c.verbose_via_string, "proxy.config.http.verbose_via_str");
 
1169
 
 
1170
  HttpEstablishStaticConfigStringAlloc(c.proxy_request_via_string, "proxy.config.http.request_via_str");
 
1171
  c.proxy_request_via_string_len = -1;
 
1172
  HttpEstablishStaticConfigStringAlloc(c.proxy_response_via_string, "proxy.config.http.response_via_str");
 
1173
  c.proxy_response_via_string_len = -1;
 
1174
 
 
1175
  HttpEstablishStaticConfigLongLong(c.wuts_enabled, "proxy.config.http.wuts_enabled");
 
1176
  HttpEstablishStaticConfigLongLong(c.log_spider_codes, "proxy.config.http.log_spider_codes");
 
1177
 
 
1178
  HttpEstablishStaticConfigStringAlloc(c.url_expansions_string, "proxy.config.dns.url_expansions");
 
1179
  HttpEstablishStaticConfigLongLong(c.proxy_server_port, "proxy.config.http.server_port");
 
1180
  HttpEstablishStaticConfigStringAlloc(c.proxy_server_other_ports, "proxy.config.http.server_other_ports");
 
1181
  HttpEstablishStaticConfigLongLong(c.oride.keep_alive_enabled, "proxy.config.http.keep_alive_enabled");
 
1182
  HttpEstablishStaticConfigLongLong(c.oride.chunking_enabled, "proxy.config.http.chunking_enabled");
 
1183
  HttpEstablishStaticConfigLongLong(c.session_auth_cache_keep_alive_enabled,
 
1184
                                   "proxy.config.http.session_auth_cache_keep_alive_enabled");
 
1185
  HttpEstablishStaticConfigLongLong(c.origin_server_pipeline, "proxy.config.http.origin_server_pipeline");
 
1186
  HttpEstablishStaticConfigLongLong(c.user_agent_pipeline, "proxy.config.http.user_agent_pipeline");
 
1187
  HttpEstablishStaticConfigLongLong(c.share_server_sessions, "proxy.config.http.share_server_sessions");
 
1188
  HttpEstablishStaticConfigLongLong(c.oride.keep_alive_post_out, "proxy.config.http.keep_alive_post_out");
 
1189
 
 
1190
  HttpEstablishStaticConfigLongLong(c.oride.keep_alive_no_activity_timeout_in,
 
1191
                                    "proxy.config.http.keep_alive_no_activity_timeout_in");
 
1192
  HttpEstablishStaticConfigLongLong(c.keep_alive_no_activity_timeout_out,
 
1193
                                    "proxy.config.http.keep_alive_no_activity_timeout_out");
 
1194
  HttpEstablishStaticConfigLongLong(c.oride.transaction_no_activity_timeout_in,
 
1195
                                    "proxy.config.http.transaction_no_activity_timeout_in");
 
1196
  HttpEstablishStaticConfigLongLong(c.oride.transaction_no_activity_timeout_out,
 
1197
                                    "proxy.config.http.transaction_no_activity_timeout_out");
 
1198
  HttpEstablishStaticConfigLongLong(c.transaction_active_timeout_in, "proxy.config.http.transaction_active_timeout_in");
 
1199
  HttpEstablishStaticConfigLongLong(c.oride.transaction_active_timeout_out,
 
1200
                                    "proxy.config.http.transaction_active_timeout_out");
 
1201
  HttpEstablishStaticConfigLongLong(c.accept_no_activity_timeout, "proxy.config.http.accept_no_activity_timeout");
 
1202
 
 
1203
  HttpEstablishStaticConfigLongLong(c.background_fill_active_timeout,
 
1204
                                    "proxy.config.http.background_fill_active_timeout");
 
1205
  HttpEstablishStaticConfigFloat(c.background_fill_threshold, "proxy.config.http.background_fill_completed_threshold");
 
1206
 
 
1207
  HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_max_retries, "proxy.config.http.connect_attempts_max_retries");
 
1208
  HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_max_retries_dead_server,
 
1209
                                    "proxy.config.http.connect_attempts_max_retries_dead_server");
 
1210
 
 
1211
  HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_rr_retries, "proxy.config.http.connect_attempts_rr_retries");
 
1212
  HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_timeout, "proxy.config.http.connect_attempts_timeout");
 
1213
  HttpEstablishStaticConfigLongLong(c.oride.post_connect_attempts_timeout, "proxy.config.http.post_connect_attempts_timeout");
 
1214
  HttpEstablishStaticConfigLongLong(c.parent_connect_attempts, "proxy.config.http.parent_proxy.total_connect_attempts");
 
1215
  HttpEstablishStaticConfigLongLong(c.per_parent_connect_attempts,
 
1216
                                    "proxy.config.http.parent_proxy.per_parent_connect_attempts");
 
1217
  HttpEstablishStaticConfigLongLong(c.parent_connect_timeout,
 
1218
                                    "proxy.config.http.parent_proxy.connect_attempts_timeout");
 
1219
 
 
1220
  HttpEstablishStaticConfigLongLong(c.oride.sock_recv_buffer_size_out, "proxy.config.net.sock_recv_buffer_size_out");
 
1221
  HttpEstablishStaticConfigLongLong(c.oride.sock_send_buffer_size_out, "proxy.config.net.sock_send_buffer_size_out");
 
1222
  HttpEstablishStaticConfigLongLong(c.oride.sock_option_flag_out, "proxy.config.net.sock_option_flag_out");
 
1223
 
 
1224
  c.fwd_proxy_auth_to_parent = 0;
 
1225
 
 
1226
  HttpEstablishStaticConfigLongLong(c.oride.anonymize_remove_from, "proxy.config.http.anonymize_remove_from");
 
1227
  HttpEstablishStaticConfigLongLong(c.oride.anonymize_remove_referer, "proxy.config.http.anonymize_remove_referer");
 
1228
  HttpEstablishStaticConfigLongLong(c.oride.anonymize_remove_user_agent, "proxy.config.http.anonymize_remove_user_agent");
 
1229
  HttpEstablishStaticConfigLongLong(c.oride.anonymize_remove_cookie, "proxy.config.http.anonymize_remove_cookie");
 
1230
  HttpEstablishStaticConfigLongLong(c.oride.anonymize_remove_client_ip, "proxy.config.http.anonymize_remove_client_ip");
 
1231
  HttpEstablishStaticConfigLongLong(c.oride.anonymize_insert_client_ip, "proxy.config.http.anonymize_insert_client_ip");
 
1232
  HttpEstablishStaticConfigLongLong(c.oride.append_xforwards_header, "proxy.config.http.append_xforwards_header");
 
1233
  HttpEstablishStaticConfigStringAlloc(c.anonymize_other_header_list, "proxy.config.http.anonymize_other_header_list");
 
1234
  HttpEstablishStaticConfigStringAlloc(c.global_user_agent_header, "proxy.config.http.global_user_agent_header");
 
1235
  c.global_user_agent_header_size = c.global_user_agent_header ? strlen(c.global_user_agent_header) : 0;
 
1236
 
 
1237
  HttpEstablishStaticConfigLongLong(c.oride.proxy_response_server_enabled, "proxy.config.http.response_server_enabled");
 
1238
  HttpEstablishStaticConfigStringAlloc(c.oride.proxy_response_server_string, "proxy.config.http.response_server_str");
 
1239
  c.oride.proxy_response_server_string_len = c.oride.proxy_response_server_string ?
 
1240
    strlen(c.oride.proxy_response_server_string) : 0;
 
1241
 
 
1242
  HttpEstablishStaticConfigLongLong(c.oride.insert_squid_x_forwarded_for, "proxy.config.http.insert_squid_x_forwarded_for");
 
1243
 
 
1244
 
 
1245
  HttpEstablishStaticConfigLongLong(c.insert_age_in_response, "proxy.config.http.insert_age_in_response");
 
1246
 
 
1247
  HttpEstablishStaticConfigLongLong(c.avoid_content_spoofing, "proxy.config.http.avoid_content_spoofing");
 
1248
 
 
1249
  HttpEstablishStaticConfigLongLong(c.enable_http_stats, "proxy.config.http.enable_http_stats");
 
1250
 
 
1251
  HttpEstablishStaticConfigLongLong(c.normalize_ae_gzip, "proxy.config.http.normalize_ae_gzip");
 
1252
 
 
1253
  HttpEstablishStaticConfigLongLong(c.icp_enabled, "proxy.config.icp.enabled");
 
1254
  HttpEstablishStaticConfigLongLong(c.stale_icp_enabled, "proxy.config.icp.stale_icp_enabled");
 
1255
 
 
1256
  HttpEstablishStaticConfigLongLong(c.oride.cache_heuristic_min_lifetime, "proxy.config.http.cache.heuristic_min_lifetime");
 
1257
  HttpEstablishStaticConfigLongLong(c.oride.cache_heuristic_max_lifetime, "proxy.config.http.cache.heuristic_max_lifetime");
 
1258
  HttpEstablishStaticConfigFloat(c.oride.cache_heuristic_lm_factor, "proxy.config.http.cache.heuristic_lm_factor");
 
1259
 
 
1260
  HttpEstablishStaticConfigLongLong(c.oride.cache_guaranteed_min_lifetime, "proxy.config.http.cache.guaranteed_min_lifetime");
 
1261
  HttpEstablishStaticConfigLongLong(c.oride.cache_guaranteed_max_lifetime, "proxy.config.http.cache.guaranteed_max_lifetime");
 
1262
 
 
1263
  HttpEstablishStaticConfigLongLong(c.oride.cache_max_stale_age, "proxy.config.http.cache.max_stale_age");
 
1264
 
 
1265
  HttpEstablishStaticConfigLongLong(c.oride.freshness_fuzz_time, "proxy.config.http.cache.fuzz.time");
 
1266
  HttpEstablishStaticConfigLongLong(c.oride.freshness_fuzz_min_time, "proxy.config.http.cache.fuzz.min_time");
 
1267
  HttpEstablishStaticConfigFloat(c.oride.freshness_fuzz_prob, "proxy.config.http.cache.fuzz.probability");
 
1268
 
 
1269
  HttpEstablishStaticConfigStringAlloc(c.cache_vary_default_text, "proxy.config.http.cache.vary_default_text");
 
1270
  HttpEstablishStaticConfigStringAlloc(c.cache_vary_default_images, "proxy.config.http.cache.vary_default_images");
 
1271
  HttpEstablishStaticConfigStringAlloc(c.cache_vary_default_other, "proxy.config.http.cache.vary_default_other");
 
1272
 
 
1273
  // open read failure retries
 
1274
  HttpEstablishStaticConfigLongLong(c.max_cache_open_read_retries, "proxy.config.http.cache.max_open_read_retries");
 
1275
  HttpEstablishStaticConfigLongLong(c.cache_open_read_retry_time, "proxy.config.http.cache.open_read_retry_time");
 
1276
 
 
1277
  // open write failure retries
 
1278
  HttpEstablishStaticConfigLongLong(c.max_cache_open_write_retries, "proxy.config.http.cache.max_open_write_retries");
 
1279
  HttpEstablishStaticConfigLongLong(c.cache_open_write_retry_time, "proxy.config.http.cache.open_write_retry_time");
 
1280
 
 
1281
  HttpEstablishStaticConfigLongLong(c.oride.cache_http, "proxy.config.http.cache.http");
 
1282
  HttpEstablishStaticConfigLongLong(c.oride.cache_ignore_client_no_cache, "proxy.config.http.cache.ignore_client_no_cache");
 
1283
  HttpEstablishStaticConfigLongLong(c.oride.cache_ignore_client_cc_max_age,
 
1284
                                    "proxy.config.http.cache.ignore_client_cc_max_age");
 
1285
  HttpEstablishStaticConfigLongLong(c.oride.cache_ims_on_client_no_cache, "proxy.config.http.cache.ims_on_client_no_cache");
 
1286
  HttpEstablishStaticConfigLongLong(c.oride.cache_ignore_server_no_cache, "proxy.config.http.cache.ignore_server_no_cache");
 
1287
  HttpEstablishStaticConfigLongLong(c.oride.cache_responses_to_cookies, "proxy.config.http.cache.cache_responses_to_cookies");
 
1288
 
 
1289
  HttpEstablishStaticConfigLongLong(c.oride.cache_ignore_auth, "proxy.config.http.cache.ignore_authentication");
 
1290
  HttpEstablishStaticConfigLongLong(c.oride.cache_urls_that_look_dynamic,
 
1291
                                    "proxy.config.http.cache.cache_urls_that_look_dynamic");
 
1292
  HttpEstablishStaticConfigLongLong(c.cache_enable_default_vary_headers,
 
1293
                                    "proxy.config.http.cache.enable_default_vary_headers");
 
1294
 
 
1295
  HttpEstablishStaticConfigLongLong(c.ignore_accept_mismatch, "proxy.config.http.cache.ignore_accept_mismatch");
 
1296
  HttpEstablishStaticConfigLongLong(c.ignore_accept_language_mismatch,
 
1297
                                    "proxy.config.http.cache.ignore_accept_language_mismatch");
 
1298
  HttpEstablishStaticConfigLongLong(c.ignore_accept_encoding_mismatch,
 
1299
                                    "proxy.config.http.cache.ignore_accept_encoding_mismatch");
 
1300
  HttpEstablishStaticConfigLongLong(c.ignore_accept_charset_mismatch,
 
1301
                                    "proxy.config.http.cache.ignore_accept_charset_mismatch");
 
1302
 
 
1303
  HttpEstablishStaticConfigLongLong(c.oride.cache_when_to_revalidate, "proxy.config.http.cache.when_to_revalidate");
 
1304
  HttpEstablishStaticConfigLongLong(c.cache_when_to_add_no_cache_to_msie_requests,
 
1305
                                    "proxy.config.http.cache.when_to_add_no_cache_to_msie_requests");
 
1306
  HttpEstablishStaticConfigLongLong(c.oride.cache_required_headers, "proxy.config.http.cache.required_headers");
 
1307
  HttpEstablishStaticConfigLongLong(c.cache_range_lookup, "proxy.config.http.cache.range.lookup");
 
1308
 
 
1309
  HttpEstablishStaticConfigStringAlloc(c.connect_ports_string, "proxy.config.http.connect_ports");
 
1310
 
 
1311
  HttpEstablishStaticConfigLongLong(c.request_hdr_max_size, "proxy.config.http.request_header_max_size");
 
1312
 
 
1313
  HttpEstablishStaticConfigLongLong(c.response_hdr_max_size, "proxy.config.http.response_header_max_size");
 
1314
 
 
1315
  HttpEstablishStaticConfigLongLong(c.push_method_enabled, "proxy.config.http.push_method_enabled");
 
1316
 
 
1317
  HttpEstablishStaticConfigLongLong(c.reverse_proxy_enabled, "proxy.config.reverse_proxy.enabled");
 
1318
  HttpEstablishStaticConfigLongLong(c.url_remap_required, "proxy.config.url_remap.remap_required");
 
1319
 
 
1320
  HttpEstablishStaticConfigStringAlloc(c.reverse_proxy_no_host_redirect,
 
1321
                                       "proxy.config.header.parse.no_host_url_redirect");
 
1322
  c.reverse_proxy_no_host_redirect_len = -1;
 
1323
 
 
1324
  HttpEstablishStaticConfigLongLong(c.errors_log_error_pages, "proxy.config.http.errors.log_error_pages");
 
1325
 
 
1326
  HttpEstablishStaticConfigLongLong(c.slow_log_threshold, "proxy.config.http.slow.log.threshold");
 
1327
 
 
1328
  HttpEstablishStaticConfigLongLong(c.record_cop_page, "proxy.config.http.record_heartbeat");
 
1329
 
 
1330
  HttpEstablishStaticConfigLongLong(c.record_tcp_mem_hit, "proxy.config.http.record_tcp_mem_hit");
 
1331
 
 
1332
  HttpEstablishStaticConfigLongLong(c.oride.send_http11_requests, "proxy.config.http.send_http11_requests");
 
1333
 
 
1334
  // HTTP Referer Filtering
 
1335
  HttpEstablishStaticConfigLongLong(c.referer_filter_enabled, "proxy.config.http.referer_filter");
 
1336
  HttpEstablishStaticConfigLongLong(c.referer_format_redirect, "proxy.config.http.referer_format_redirect");
 
1337
 
 
1338
  // HTTP Accept_Encoding filtering (depends on User-Agent)
 
1339
  HttpEstablishStaticConfigLongLong(c.accept_encoding_filter_enabled, "proxy.config.http.accept_encoding_filter_enabled");
 
1340
 
 
1341
  // HTTP Quick filter
 
1342
  HttpEstablishStaticConfigLongLong(c.quick_filter_mask, "proxy.config.http.quick_filter.mask");
 
1343
 
 
1344
  // Negative caching
 
1345
  HttpEstablishStaticConfigLongLong(c.oride.down_server_timeout, "proxy.config.http.down_server.cache_time");
 
1346
  HttpEstablishStaticConfigLongLong(c.oride.client_abort_threshold, "proxy.config.http.down_server.abort_threshold");
 
1347
 
 
1348
  // Negative revalidating
 
1349
  HttpEstablishStaticConfigLongLong(c.negative_revalidating_enabled, "proxy.config.http.negative_revalidating_enabled");
 
1350
  HttpEstablishStaticConfigLongLong(c.negative_revalidating_lifetime, "proxy.config.http.negative_revalidating_lifetime");
 
1351
 
 
1352
  // Negative response caching
 
1353
  HttpEstablishStaticConfigLongLong(c.oride.negative_caching_enabled, "proxy.config.http.negative_caching_enabled");
 
1354
  HttpEstablishStaticConfigLongLong(c.oride.negative_caching_lifetime, "proxy.config.http.negative_caching_lifetime");
 
1355
 
 
1356
  // Buffer size
 
1357
  HttpEstablishStaticConfigLongLong(c.default_buffer_size_index, "proxy.config.http.default_buffer_size");
 
1358
 
 
1359
  // Buffer water mark
 
1360
  HttpEstablishStaticConfigLongLong(c.default_buffer_water_mark, "proxy.config.http.default_buffer_water_mark");
 
1361
 
 
1362
  // Stat Page Info
 
1363
  HttpEstablishStaticConfigLongLong(c.enable_http_info, "proxy.config.http.enable_http_info");
 
1364
 
 
1365
 
 
1366
  ///////////////////////////////////////////////////////////////////////////
 
1367
  //   Added by YTS Team, yamsat                                                //
 
1368
  //   Connection collapsing Configuration parameters                      //
 
1369
  // 1. hashtable_enabled: if set to 1, requests will first search the     //
 
1370
  //    hashtable to see if another similar request is already being served//
 
1371
  // 2. rww_wait_time: read-while-write wait time: While read while write  //
 
1372
  //    is enabled, the secondary clients will wait this amount of time    //
 
1373
  //    after which cache lookup is retried                                //
 
1374
  // 3. revaildate_window_period: while revaidation of a cached object is  //
 
1375
  //    being done, the secondary clients for the same url will serve the  //
 
1376
  //    stale object for this amount of time, after the revalidation had   //
 
1377
  //    started                                                            //
 
1378
  ///////////////////////////////////////////////////////////////////////////
 
1379
 
 
1380
  HttpEstablishStaticConfigLongLong(c.hashtable_enabled, "proxy.config.connection_collapsing.hashtable_enabled");
 
1381
 
 
1382
  HttpEstablishStaticConfigLongLong(c.rww_wait_time, "proxy.config.connection_collapsing.rww_wait_time");
 
1383
 
 
1384
  HttpEstablishStaticConfigLongLong(c.revalidate_window_period,
 
1385
                                    "proxy.config.connection_collapsing.revalidate_window_period");
 
1386
 
 
1387
  HttpEstablishStaticConfigLongLong(c.srv_enabled, "proxy.config.srv_enabled");
 
1388
 
 
1389
  //##############################################################################
 
1390
  //#
 
1391
  //# Redirection
 
1392
  //#
 
1393
  //# 1. redirection_enabled: if set to 1, redirection is enabled.
 
1394
  //# 2. number_of_redirections: The maximum number of redirections YTS permits
 
1395
  //# 3. post_copy_size: The maximum POST data size YTS permits to copy
 
1396
  //#
 
1397
  //##############################################################################
 
1398
 
 
1399
  HttpEstablishStaticConfigLongLong(c.redirection_enabled, "proxy.config.http.redirection_enabled");
 
1400
 
 
1401
  HttpEstablishStaticConfigLongLong(c.number_of_redirections, "proxy.config.http.number_of_redirections");
 
1402
 
 
1403
  HttpEstablishStaticConfigLongLong(c.post_copy_size, "proxy.config.http.post_copy_size");
 
1404
 
 
1405
  // Transparency flag.
 
1406
  char buffer[10];
 
1407
  if (REC_ERR_OKAY ==  RecGetRecordString("proxy.config.http.transparent",
 
1408
                                          buffer, sizeof(buffer))) {
 
1409
    if (0 == strcasecmp("both", buffer) ||
 
1410
        0 == strcasecmp("on", buffer) ||
 
1411
        0 == strcasecmp("enable", buffer)) {
 
1412
      c.client_transparency_enabled = true;
 
1413
      c.server_transparency_enabled = true;
 
1414
    } else if (0 == strcasecmp("server", buffer)) {
 
1415
      c.server_transparency_enabled = true;
 
1416
      c.client_transparency_enabled = false;
 
1417
    } else if (0 == strcasecmp("client", buffer)) {
 
1418
      c.server_transparency_enabled = false;
 
1419
      c.client_transparency_enabled = true;
 
1420
    } else {
 
1421
      c.server_transparency_enabled = false;
 
1422
      c.client_transparency_enabled = false;
 
1423
    }
 
1424
  }
 
1425
 
 
1426
  // Cluster time delta gets it own callback since it needs
 
1427
  //  to use ink_atomic_swap
 
1428
  c.cluster_time_delta = 0;
 
1429
  RegisterMgmtCallback(MGMT_EVENT_HTTP_CLUSTER_DELTA, cluster_delta_cb, NULL);
 
1430
 
 
1431
  http_config_cont->handleEvent(EVENT_NONE, NULL);
 
1432
 
 
1433
  return;
 
1434
}
 
1435
 
 
1436
////////////////////////////////////////////////////////////////
 
1437
//
 
1438
//  HttpConfig::reconfigure()
 
1439
//
 
1440
////////////////////////////////////////////////////////////////
 
1441
void
 
1442
HttpConfig::reconfigure()
 
1443
{
 
1444
#define INT_TO_BOOL(i) ((i) ? 1 : 0);
 
1445
 
 
1446
  HttpConfigParams *params;
 
1447
 
 
1448
  params = NEW(new HttpConfigParams);
 
1449
 
 
1450
  params->incoming_ip_to_bind_saddr = m_master.incoming_ip_to_bind_saddr;
 
1451
  params->outgoing_ip_to_bind_saddr = m_master.outgoing_ip_to_bind_saddr;
 
1452
  params->proxy_hostname = xstrdup(m_master.proxy_hostname);
 
1453
  params->proxy_hostname_len = (params->proxy_hostname) ? strlen(params->proxy_hostname) : 0;
 
1454
  params->no_dns_forward_to_parent = INT_TO_BOOL(m_master.no_dns_forward_to_parent);
 
1455
  params->uncacheable_requests_bypass_parent = INT_TO_BOOL(m_master.uncacheable_requests_bypass_parent);
 
1456
  params->no_origin_server_dns = INT_TO_BOOL(m_master.no_origin_server_dns);
 
1457
  params->use_client_target_addr = INT_TO_BOOL(m_master.use_client_target_addr);
 
1458
  params->oride.maintain_pristine_host_hdr = INT_TO_BOOL(m_master.oride.maintain_pristine_host_hdr);
 
1459
 
 
1460
  params->snarf_username_from_authorization = INT_TO_BOOL(m_master.snarf_username_from_authorization);
 
1461
 
 
1462
  params->disable_ssl_parenting = m_master.disable_ssl_parenting;
 
1463
 
 
1464
  params->server_max_connections = m_master.server_max_connections;
 
1465
  params->oride.origin_max_connections = m_master.oride.origin_max_connections;
 
1466
  params->origin_min_keep_alive_connections = m_master.origin_min_keep_alive_connections;
 
1467
 
 
1468
  if (params->oride.origin_max_connections &&
 
1469
      params->oride.origin_max_connections < params->origin_min_keep_alive_connections ) {
 
1470
    Warning("origin_max_connections < origin_min_keep_alive_connections, setting min=max , please correct your records.config");
 
1471
    params->origin_min_keep_alive_connections = params->oride.origin_max_connections;
 
1472
  }
 
1473
 
 
1474
  params->parent_proxy_routing_enable = INT_TO_BOOL(m_master.parent_proxy_routing_enable);
 
1475
  params->fwd_proxy_auth_to_parent = 0;
 
1476
  params->enable_url_expandomatic = INT_TO_BOOL(m_master.enable_url_expandomatic);
 
1477
 
 
1478
  params->oride.insert_request_via_string = INT_TO_BOOL(m_master.oride.insert_request_via_string);
 
1479
  params->oride.insert_response_via_string = INT_TO_BOOL(m_master.oride.insert_response_via_string);
 
1480
  params->verbose_via_string = m_master.verbose_via_string;
 
1481
  params->proxy_request_via_string = xstrdup(m_master.proxy_request_via_string);
 
1482
  params->proxy_request_via_string_len = (params->proxy_request_via_string) ? strlen(params->proxy_request_via_string) : 0;
 
1483
  params->proxy_response_via_string = xstrdup(m_master.proxy_response_via_string);
 
1484
  params->proxy_response_via_string_len = (params->proxy_response_via_string) ? strlen(params->proxy_response_via_string) : 0;
 
1485
 
 
1486
  params->wuts_enabled = INT_TO_BOOL(m_master.wuts_enabled);
 
1487
  params->log_spider_codes = INT_TO_BOOL(m_master.log_spider_codes);
 
1488
 
 
1489
  params->url_expansions_string = xstrdup(m_master.url_expansions_string);
 
1490
  params->url_expansions = parse_url_expansions(params->url_expansions_string, &params->num_url_expansions);
 
1491
 
 
1492
  params->proxy_server_port = m_master.proxy_server_port;
 
1493
  params->proxy_server_other_ports = xstrdup(m_master.proxy_server_other_ports);
 
1494
  params->oride.keep_alive_enabled = INT_TO_BOOL(m_master.oride.keep_alive_enabled);
 
1495
  params->oride.chunking_enabled = INT_TO_BOOL(m_master.oride.chunking_enabled);
 
1496
  params->session_auth_cache_keep_alive_enabled = INT_TO_BOOL(m_master.session_auth_cache_keep_alive_enabled);
 
1497
  params->origin_server_pipeline = m_master.origin_server_pipeline;
 
1498
  params->user_agent_pipeline = m_master.user_agent_pipeline;
 
1499
  params->share_server_sessions = INT_TO_BOOL(m_master.share_server_sessions);
 
1500
  params->oride.keep_alive_post_out = m_master.oride.keep_alive_post_out;
 
1501
 
 
1502
  params->oride.keep_alive_no_activity_timeout_in = m_master.oride.keep_alive_no_activity_timeout_in;
 
1503
  params->keep_alive_no_activity_timeout_out = m_master.keep_alive_no_activity_timeout_out;
 
1504
  params->oride.transaction_no_activity_timeout_in = m_master.oride.transaction_no_activity_timeout_in;
 
1505
  params->oride.transaction_no_activity_timeout_out = m_master.oride.transaction_no_activity_timeout_out;
 
1506
  params->transaction_active_timeout_in = m_master.transaction_active_timeout_in;
 
1507
  params->oride.transaction_active_timeout_out = m_master.oride.transaction_active_timeout_out;
 
1508
  params->accept_no_activity_timeout = m_master.accept_no_activity_timeout;
 
1509
  params->background_fill_active_timeout = m_master.background_fill_active_timeout;
 
1510
  params->background_fill_threshold = m_master.background_fill_threshold;
 
1511
 
 
1512
  params->oride.connect_attempts_max_retries = m_master.oride.connect_attempts_max_retries;
 
1513
  params->oride.connect_attempts_max_retries_dead_server = m_master.oride.connect_attempts_max_retries_dead_server;
 
1514
  params->oride.connect_attempts_rr_retries = m_master.oride.connect_attempts_rr_retries;
 
1515
  params->oride.connect_attempts_timeout = m_master.oride.connect_attempts_timeout;
 
1516
  params->oride.post_connect_attempts_timeout = m_master.oride.post_connect_attempts_timeout;
 
1517
  params->parent_connect_attempts = m_master.parent_connect_attempts;
 
1518
  params->per_parent_connect_attempts = m_master.per_parent_connect_attempts;
 
1519
  params->parent_connect_timeout = m_master.parent_connect_timeout;
 
1520
 
 
1521
  params->oride.sock_recv_buffer_size_out = m_master.oride.sock_recv_buffer_size_out;
 
1522
  params->oride.sock_send_buffer_size_out = m_master.oride.sock_send_buffer_size_out;
 
1523
  params->oride.sock_option_flag_out = m_master.oride.sock_option_flag_out;
 
1524
 
 
1525
  params->oride.anonymize_remove_from = INT_TO_BOOL(m_master.oride.anonymize_remove_from);
 
1526
  params->oride.anonymize_remove_referer = INT_TO_BOOL(m_master.oride.anonymize_remove_referer);
 
1527
  params->oride.anonymize_remove_user_agent = INT_TO_BOOL(m_master.oride.anonymize_remove_user_agent);
 
1528
  params->oride.anonymize_remove_cookie = INT_TO_BOOL(m_master.oride.anonymize_remove_cookie);
 
1529
  params->oride.anonymize_remove_client_ip = INT_TO_BOOL(m_master.oride.anonymize_remove_client_ip);
 
1530
  params->oride.anonymize_insert_client_ip = INT_TO_BOOL(m_master.oride.anonymize_insert_client_ip);
 
1531
  params->oride.append_xforwards_header = INT_TO_BOOL(m_master.oride.append_xforwards_header);
 
1532
  params->anonymize_other_header_list = xstrdup(m_master.anonymize_other_header_list);
 
1533
 
 
1534
  params->global_user_agent_header = xstrdup(m_master.global_user_agent_header);
 
1535
  params->global_user_agent_header_size = params->global_user_agent_header ?
 
1536
    strlen(params->global_user_agent_header) : 0;
 
1537
 
 
1538
  params->oride.proxy_response_server_string = xstrdup(m_master.oride.proxy_response_server_string);
 
1539
  params->oride.proxy_response_server_string_len = params->oride.proxy_response_server_string ?
 
1540
    strlen(params->oride.proxy_response_server_string) : 0;
 
1541
  params->oride.proxy_response_server_enabled = m_master.oride.proxy_response_server_enabled;
 
1542
 
 
1543
  params->oride.insert_squid_x_forwarded_for = INT_TO_BOOL(m_master.oride.insert_squid_x_forwarded_for);
 
1544
  params->insert_age_in_response = INT_TO_BOOL(m_master.insert_age_in_response);
 
1545
  params->avoid_content_spoofing = INT_TO_BOOL(m_master.avoid_content_spoofing);
 
1546
  params->enable_http_stats = INT_TO_BOOL(m_master.enable_http_stats);
 
1547
  params->normalize_ae_gzip = INT_TO_BOOL(m_master.normalize_ae_gzip);
 
1548
 
 
1549
  params->icp_enabled = (m_master.icp_enabled == ICP_MODE_SEND_RECEIVE ? 1 : 0);
 
1550
  params->stale_icp_enabled = m_master.stale_icp_enabled;
 
1551
 
 
1552
  params->oride.cache_heuristic_min_lifetime = m_master.oride.cache_heuristic_min_lifetime;
 
1553
  params->oride.cache_heuristic_max_lifetime = m_master.oride.cache_heuristic_max_lifetime;
 
1554
  params->oride.cache_heuristic_lm_factor = min(max(m_master.oride.cache_heuristic_lm_factor, 0), 1);
 
1555
 
 
1556
  params->oride.cache_guaranteed_min_lifetime = m_master.oride.cache_guaranteed_min_lifetime;
 
1557
  params->oride.cache_guaranteed_max_lifetime = m_master.oride.cache_guaranteed_max_lifetime;
 
1558
 
 
1559
  params->oride.cache_max_stale_age = m_master.oride.cache_max_stale_age;
 
1560
  params->oride.freshness_fuzz_time = m_master.oride.freshness_fuzz_time;
 
1561
  params->oride.freshness_fuzz_min_time = m_master.oride.freshness_fuzz_min_time;
 
1562
  params->oride.freshness_fuzz_prob = m_master.oride.freshness_fuzz_prob;
 
1563
 
 
1564
  params->cache_vary_default_text = xstrdup(m_master.cache_vary_default_text);
 
1565
  params->cache_vary_default_images = xstrdup(m_master.cache_vary_default_images);
 
1566
  params->cache_vary_default_other = xstrdup(m_master.cache_vary_default_other);
 
1567
 
 
1568
  // open read failure retries
 
1569
  params->max_cache_open_read_retries = m_master.max_cache_open_read_retries;
 
1570
  params->cache_open_read_retry_time = m_master.cache_open_read_retry_time;
 
1571
 
 
1572
  // open write failure retries
 
1573
  params->max_cache_open_write_retries = m_master.max_cache_open_write_retries;
 
1574
  params->cache_open_write_retry_time = m_master.cache_open_write_retry_time;
 
1575
 
 
1576
  // open write failure retries
 
1577
  params->max_cache_open_write_retries = m_master.max_cache_open_write_retries;
 
1578
  params->cache_open_write_retry_time = m_master.cache_open_write_retry_time;
 
1579
 
 
1580
  params->oride.cache_http = INT_TO_BOOL(m_master.oride.cache_http);
 
1581
  params->oride.cache_ignore_client_no_cache = INT_TO_BOOL(m_master.oride.cache_ignore_client_no_cache);
 
1582
  params->oride.cache_ignore_client_cc_max_age = INT_TO_BOOL(m_master.oride.cache_ignore_client_cc_max_age);
 
1583
  params->oride.cache_ims_on_client_no_cache = INT_TO_BOOL(m_master.oride.cache_ims_on_client_no_cache);
 
1584
  params->oride.cache_ignore_server_no_cache = INT_TO_BOOL(m_master.oride.cache_ignore_server_no_cache);
 
1585
  params->oride.cache_responses_to_cookies = m_master.oride.cache_responses_to_cookies;
 
1586
  params->oride.cache_ignore_auth = INT_TO_BOOL(m_master.oride.cache_ignore_auth);
 
1587
  params->oride.cache_urls_that_look_dynamic = INT_TO_BOOL(m_master.oride.cache_urls_that_look_dynamic);
 
1588
  params->cache_enable_default_vary_headers = INT_TO_BOOL(m_master.cache_enable_default_vary_headers);
 
1589
 
 
1590
  params->ignore_accept_mismatch = INT_TO_BOOL(m_master.ignore_accept_mismatch);
 
1591
  params->ignore_accept_language_mismatch = INT_TO_BOOL(m_master.ignore_accept_language_mismatch);
 
1592
  params->ignore_accept_encoding_mismatch = INT_TO_BOOL(m_master.ignore_accept_encoding_mismatch);
 
1593
  params->ignore_accept_charset_mismatch = INT_TO_BOOL(m_master.ignore_accept_charset_mismatch);
 
1594
 
 
1595
  params->oride.cache_when_to_revalidate = m_master.oride.cache_when_to_revalidate;
 
1596
  params->cache_when_to_add_no_cache_to_msie_requests = m_master.cache_when_to_add_no_cache_to_msie_requests;
 
1597
 
 
1598
  params->oride.cache_required_headers = m_master.oride.cache_required_headers;
 
1599
  params->cache_range_lookup = INT_TO_BOOL(m_master.cache_range_lookup);
 
1600
 
 
1601
  params->connect_ports_string = xstrdup(m_master.connect_ports_string);
 
1602
  params->connect_ports = parse_ports_list(params->connect_ports_string);
 
1603
 
 
1604
  params->request_hdr_max_size = m_master.request_hdr_max_size;
 
1605
  params->response_hdr_max_size = m_master.response_hdr_max_size;
 
1606
  params->push_method_enabled = m_master.push_method_enabled;
 
1607
 
 
1608
  params->reverse_proxy_enabled = INT_TO_BOOL(m_master.reverse_proxy_enabled);
 
1609
  params->url_remap_required = INT_TO_BOOL(m_master.url_remap_required);
 
1610
  params->errors_log_error_pages = INT_TO_BOOL(m_master.errors_log_error_pages);
 
1611
  params->slow_log_threshold = m_master.slow_log_threshold;
 
1612
  params->record_cop_page = INT_TO_BOOL(m_master.record_cop_page);
 
1613
  params->record_tcp_mem_hit = INT_TO_BOOL(m_master.record_tcp_mem_hit);
 
1614
  params->oride.send_http11_requests = m_master.oride.send_http11_requests;
 
1615
  params->doc_in_cache_skip_dns = m_master.doc_in_cache_skip_dns;
 
1616
  params->default_buffer_size_index = m_master.default_buffer_size_index;
 
1617
  params->default_buffer_water_mark = m_master.default_buffer_water_mark;
 
1618
  params->enable_http_info = INT_TO_BOOL(m_master.enable_http_info);
 
1619
  params->reverse_proxy_no_host_redirect = xstrdup(m_master.reverse_proxy_no_host_redirect);
 
1620
  params->reverse_proxy_no_host_redirect_len =
 
1621
    params->reverse_proxy_no_host_redirect ? strlen(params->reverse_proxy_no_host_redirect) : 0;
 
1622
 
 
1623
  params->referer_filter_enabled = m_master.referer_filter_enabled;
 
1624
  params->referer_format_redirect = m_master.referer_format_redirect;
 
1625
 
 
1626
  params->accept_encoding_filter_enabled = m_master.accept_encoding_filter_enabled;
 
1627
 
 
1628
  params->quick_filter_mask = m_master.quick_filter_mask;
 
1629
 
 
1630
  params->oride.down_server_timeout = m_master.oride.down_server_timeout;
 
1631
  params->oride.client_abort_threshold = m_master.oride.client_abort_threshold;
 
1632
 
 
1633
  params->negative_revalidating_enabled = m_master.negative_revalidating_enabled;
 
1634
  params->negative_revalidating_lifetime = m_master.negative_revalidating_lifetime;
 
1635
 
 
1636
  params->oride.negative_caching_enabled = m_master.oride.negative_caching_enabled;
 
1637
  params->oride.negative_caching_lifetime = m_master.oride.negative_caching_lifetime;
 
1638
 
 
1639
  ///////////////////////////////////////////////////////////////////////////
 
1640
  //  Added by YTS Team, yamsat                                                 //
 
1641
  //   Connection collapsing Configuration parameters                      //
 
1642
  // 1. hashtable_enabled: if set to 1, requests will first search the     //
 
1643
  //    hashtable to see if another similar request is already being served//
 
1644
  // 2. rww_wait_time: read-while-write wait time: While read while write  //
 
1645
  //    is enabled, the secondary clients will wait this amount of time    //
 
1646
  //    after which cache lookup is retried                                //
 
1647
  // 3. revaildate_window_period: while revaidation of a cached object is  //
 
1648
  //    being done, the secondary clients for the same url will serve the  //
 
1649
  //    stale object for this amount of time, after the revalidation had   //
 
1650
  //    started                                                            //
 
1651
  ///////////////////////////////////////////////////////////////////////////
 
1652
 
 
1653
  params->hashtable_enabled = INT_TO_BOOL(m_master.hashtable_enabled);
 
1654
  params->rww_wait_time = m_master.rww_wait_time;
 
1655
  params->revalidate_window_period = m_master.revalidate_window_period;
 
1656
 
 
1657
  //##############################################################################
 
1658
  //#
 
1659
  //# Redirection
 
1660
  //#
 
1661
  //# 1. redirection_enabled: if set to 1, redirection is enabled.
 
1662
  //# 2. number_of_redirections: The maximum number of redirections YTS permits
 
1663
  //# 3. post_copy_size: The maximum POST data size YTS permits to copy
 
1664
  //#
 
1665
  //##############################################################################
 
1666
 
 
1667
  params->redirection_enabled = INT_TO_BOOL(m_master.redirection_enabled);
 
1668
  params->number_of_redirections = m_master.number_of_redirections;
 
1669
  params->post_copy_size = m_master.post_copy_size;
 
1670
 
 
1671
  m_id = configProcessor.set(m_id, params);
 
1672
 
 
1673
#undef INT_TO_BOOL
 
1674
 
 
1675
// Connection collapsing debug statements
 
1676
  Debug("http_init", "proxy.config.connection_collapsing.hashtable_enabled = %d", params->hashtable_enabled);
 
1677
  Debug("http_init", "proxy.config.connection_collapsing.rww_wait_time = %d", params->rww_wait_time);
 
1678
  Debug("http_init", "proxy.config.connection_collapsing.revalidate_window_period = %d",
 
1679
        params->revalidate_window_period);
 
1680
 
 
1681
// Redirection debug statements
 
1682
  Debug("http_init", "proxy.config.http.redirection_enabled = %d", params->redirection_enabled);
 
1683
  Debug("http_init", "proxy.config.http.number_of_redirections = %d", params->number_of_redirections);
 
1684
 
 
1685
  Debug("http_init", "proxy.config.http.post_copy_size = %d", params->post_copy_size);
 
1686
}
 
1687
 
 
1688
////////////////////////////////////////////////////////////////
 
1689
//
 
1690
//  HttpConfig::acquire()
 
1691
//
 
1692
////////////////////////////////////////////////////////////////
 
1693
HttpConfigParams *
 
1694
HttpConfig::acquire()
 
1695
{
 
1696
  if (m_id != 0) {
 
1697
    return (HttpConfigParams *) configProcessor.get(m_id);
 
1698
  } else {
 
1699
    return NULL;
 
1700
  }
 
1701
}
 
1702
 
 
1703
////////////////////////////////////////////////////////////////
 
1704
//
 
1705
//  HttpConfig::release()
 
1706
//
 
1707
////////////////////////////////////////////////////////////////
 
1708
void
 
1709
HttpConfig::release(HttpConfigParams * params)
 
1710
{
 
1711
  configProcessor.release(m_id, params);
 
1712
}
 
1713
 
 
1714
/*
 
1715
  Static Accept-Encoding/User-Agent filtering table
 
1716
  The format of this table is compatible with ae_ua.config file
 
1717
  */
 
1718
 
 
1719
static char *static_aeua_filter_array[] = {
 
1720
//    ".substring Mozilla/4.",
 
1721
  NULL
 
1722
};
 
1723
 
 
1724
static int
 
1725
read_string(FILE * fp, char *buf, int size)
 
1726
{
 
1727
  int i, retsize = (-1);
 
1728
  if (fp && --size > 0 && buf) {
 
1729
    for (buf[(retsize = 0)] = 0; (i = fgetc(fp)) != EOF;) {
 
1730
      if (i == '\n' || i == '\r')
 
1731
        break;
 
1732
      if ((i == ' ' || i == '\t') && !retsize)
 
1733
        continue;
 
1734
      if (retsize < size)
 
1735
        buf[retsize++] = (char) i;
 
1736
    }
 
1737
    buf[retsize] = 0;
 
1738
    if (i == EOF && !retsize)
 
1739
      retsize = (-1);           /* i == EOF && retsize == 0 */
 
1740
  }
 
1741
  return retsize;
 
1742
}
 
1743
 
 
1744
static bool
 
1745
store_error_message(char *err_msg_buf, int buf_size, const char *fmt, ...)
 
1746
{
 
1747
  if (likely(err_msg_buf && buf_size > 0)) {
 
1748
    char buf[2048];
 
1749
    va_list ap;
 
1750
    va_start(ap, fmt);
 
1751
    (void) vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
 
1752
    buf[sizeof(buf) - 1] = 0;
 
1753
    err_msg_buf[0] = 0;
 
1754
    strncpy(err_msg_buf, buf, buf_size - 1);
 
1755
    err_msg_buf[buf_size - 1] = 0;
 
1756
    va_end(ap);
 
1757
  }
 
1758
  return false;
 
1759
}
 
1760
 
 
1761
////////////////////////////////////////////////////////////////
 
1762
//
 
1763
//  HttpConfig::init_aeua_filter()
 
1764
//
 
1765
////////////////////////////////////////////////////////////////
 
1766
int
 
1767
HttpConfig::init_aeua_filter(char *config_fname)
 
1768
{
 
1769
  char errmsgbuf[1024], line[2048], *c;
 
1770
  HttpUserAgent_RegxEntry *ua, **uaa, *u;
 
1771
  FILE *fp;
 
1772
  int i, size;
 
1773
  int retcount = 0;
 
1774
 
 
1775
  Debug("http_aeua", "[HttpConfig::init_aeua_filter] - Config: \"%s\"", config_fname ? config_fname : "<NULL>");
 
1776
 
 
1777
  for (uaa = &HttpConfig::user_agent_list, i = 0; static_aeua_filter_array[i]; i++) {
 
1778
    memset(errmsgbuf, 0, sizeof(errmsgbuf));
 
1779
    ua = NEW(new HttpUserAgent_RegxEntry);
 
1780
    if (!ua->create(static_aeua_filter_array[i], errmsgbuf, sizeof(errmsgbuf))) {
 
1781
      ink_error("[HttpConfig::init_aeua_filter] - internal list - %s - %s",
 
1782
                static_aeua_filter_array[i], errmsgbuf[0] ? errmsgbuf : "Unknown error");
 
1783
      delete ua;
 
1784
      ua = 0;
 
1785
    } else {
 
1786
      *uaa = ua;
 
1787
      uaa = &(ua->next);
 
1788
      retcount++;
 
1789
    }
 
1790
    Debug("http_aeua", "[HttpConfig::init_aeua_filter] - Add \"%s\" filter - %s",
 
1791
          static_aeua_filter_array[i], ua ? "Success" : "Error");
 
1792
  }
 
1793
  if (config_fname && config_fname[0]) {
 
1794
    Debug("http_aeua", "[HttpConfig::init_aeua_filter] - Opening config \"%s\"", config_fname);
 
1795
    if ((fp = fopen(config_fname, "r")) != NULL) {
 
1796
      while ((i = read_string(fp, line, (int) sizeof(line))) >= 0) {
 
1797
        if (!i)
 
1798
          continue;
 
1799
        for (c = line; *c == ' ' || *c == '\t'; c++);
 
1800
        if (*c == '#' || (size = strlen(c)) <= 0)
 
1801
          continue;
 
1802
        while (size > 0 && (c[size - 1] == ' ' || c[size - 1] == '\t' || c[size - 1] == '\n' || c[size - 1] == '\r'))
 
1803
          c[--size] = 0;
 
1804
        if (size <= 0)
 
1805
          continue;
 
1806
        Debug("http_aeua", "[HttpConfig::init_aeua_filter] - \"%s\"", c);
 
1807
        for (u = HttpConfig::user_agent_list; u; u = u->next) {
 
1808
          if (u->user_agent_str_size && u->user_agent_str && !strcmp(u->user_agent_str, c))
 
1809
            break;
 
1810
        }
 
1811
        if (!u) {
 
1812
          ua = NEW(new HttpUserAgent_RegxEntry);
 
1813
          if (!ua->create(c, errmsgbuf, sizeof(errmsgbuf))) {
 
1814
            ink_error("[HttpConfig::init_aeua_filter] - config list - %s - %s", c,
 
1815
                      errmsgbuf[0] ? errmsgbuf : "Unknown error");
 
1816
            delete ua;
 
1817
            ua = 0;
 
1818
          } else {
 
1819
            *uaa = ua;
 
1820
            uaa = &(ua->next);
 
1821
            retcount++;
 
1822
          }
 
1823
          Debug("http_aeua", "[HttpConfig::init_aeua_filter] - Add \"%s\" filter - %s", c, ua ? "Success" : "Error");
 
1824
        } else {
 
1825
          Debug("http_aeua", "[HttpConfig::init_aeua_filter] - Duplicate record \"%s\"", c);
 
1826
        }
 
1827
      }
 
1828
      fclose(fp);
 
1829
    } else {
 
1830
      ink_error("[HttpConfig::init_aeua_filter] - Can't open \"%s\"", config_fname);
 
1831
    }
 
1832
  }
 
1833
  Debug("http_aeua", "[HttpConfig::init_aeua_filter] - Added %d REGEXP filters", retcount);
 
1834
  return retcount;
 
1835
}
 
1836
 
 
1837
////////////////////////////////////////////////////////////////
 
1838
//
 
1839
//  HttpUserAgent_RegxEntry::HttpUserAgent_RegxEntry()
 
1840
//
 
1841
////////////////////////////////////////////////////////////////
 
1842
HttpUserAgent_RegxEntry::HttpUserAgent_RegxEntry()
 
1843
{
 
1844
  next = 0;
 
1845
  user_agent_str_size = 0;
 
1846
  user_agent_str = 0;
 
1847
  regx_valid = false;
 
1848
  stype = STRTYPE_UNKNOWN;
 
1849
  memset(&regx, 0, sizeof(regx));
 
1850
}
 
1851
 
 
1852
////////////////////////////////////////////////////////////////
 
1853
//
 
1854
//  HttpUserAgent_RegxEntry::~HttpUserAgent_RegxEntry()
 
1855
//
 
1856
////////////////////////////////////////////////////////////////
 
1857
HttpUserAgent_RegxEntry::~HttpUserAgent_RegxEntry()
 
1858
{
 
1859
  (void) create();              /* just for clean up */
 
1860
}
 
1861
 
 
1862
////////////////////////////////////////////////////////////////
 
1863
//
 
1864
//  HttpUserAgent_RegxEntry::create()
 
1865
//
 
1866
////////////////////////////////////////////////////////////////
 
1867
bool
 
1868
HttpUserAgent_RegxEntry::create(char *_refexp_str, char *errmsgbuf, int errmsgbuf_size)
 
1869
{
 
1870
  char *c, *refexp_str, refexp_str_buf[2048];
 
1871
  bool retcode = false;
 
1872
 
 
1873
  user_agent_str = (char *) xfree_null(user_agent_str);
 
1874
  user_agent_str_size = 0;
 
1875
  stype = STRTYPE_UNKNOWN;
 
1876
  if (regx_valid) {
 
1877
    pcre_free(regx);
 
1878
    regx_valid = false;
 
1879
  }
 
1880
  if (errmsgbuf && errmsgbuf_size > 0)
 
1881
    errmsgbuf[0] = 0;
 
1882
 
 
1883
 
 
1884
  if (_refexp_str && *_refexp_str) {
 
1885
    strncpy(refexp_str_buf, _refexp_str, sizeof(refexp_str_buf) - 1);
 
1886
    refexp_str_buf[sizeof(refexp_str_buf) - 1] = 0;
 
1887
    refexp_str = &refexp_str_buf[0];
 
1888
 
 
1889
    Debug("http_aeua", "[HttpUserAgent_RegxEntry::create] - \"%s\"", refexp_str);
 
1890
    while (*refexp_str && (*refexp_str == ' ' || *refexp_str == '\t'))
 
1891
      refexp_str++;
 
1892
    if (*refexp_str == '.') {
 
1893
      for (c = refexp_str; *refexp_str && *refexp_str != ' ' && *refexp_str != '\t'; refexp_str++);
 
1894
      while (*refexp_str && (*refexp_str == ' ' || *refexp_str == '\t'))
 
1895
        *refexp_str++ = 0;
 
1896
      if (*refexp_str) {
 
1897
        if (!strcasecmp(c, ".substring") || !strcasecmp(c, ".string"))
 
1898
          stype = STRTYPE_SUBSTR_CASE;
 
1899
        else if (!strcasecmp(c, ".substring_ncase") || !strcasecmp(c, ".string_ncase"))
 
1900
          stype = STRTYPE_SUBSTR_NCASE;
 
1901
        else if (!strcasecmp(c, ".regexp") || !strcasecmp(c, ".regex"))
 
1902
          stype = STRTYPE_REGEXP;
 
1903
        else
 
1904
          return store_error_message(errmsgbuf, errmsgbuf_size, "Unknown string type \"%s\"", c);
 
1905
      } else
 
1906
        return store_error_message(errmsgbuf, errmsgbuf_size, "Empty string with \"%s\" string type", c);
 
1907
    } else
 
1908
      return store_error_message(errmsgbuf, errmsgbuf_size, "Incorrect string type - must start with '.'");
 
1909
 
 
1910
    if ((user_agent_str = xstrdup(refexp_str)) != NULL) {
 
1911
      retcode = true;
 
1912
      if (stype == STRTYPE_REGEXP) {
 
1913
        const char* error;
 
1914
        int erroffset;
 
1915
 
 
1916
        regx = pcre_compile((const char *) user_agent_str, PCRE_CASELESS, &error, &erroffset, NULL);
 
1917
        if (regx == NULL) {
 
1918
          if (errmsgbuf && (errmsgbuf_size - 1) > 0)
 
1919
            ink_strncpy(errmsgbuf, error, errmsgbuf_size - 1);
 
1920
          user_agent_str = (char *) xfree_null(user_agent_str);
 
1921
          retcode = false;
 
1922
        } else
 
1923
          regx_valid = true;
 
1924
      }
 
1925
      user_agent_str_size = user_agent_str ? strlen(user_agent_str) : 0;
 
1926
    } else
 
1927
      return store_error_message(errmsgbuf, errmsgbuf_size, "Memory allocation error (xstrdup)");
 
1928
  }
 
1929
  return retcode;
 
1930
}
 
1931
 
 
1932
////////////////////////////////////////////////////////////////
 
1933
//
 
1934
//  HttpConfig::parse_ports_list()
 
1935
//
 
1936
////////////////////////////////////////////////////////////////
 
1937
HttpConfigPortRange *
 
1938
HttpConfig::parse_ports_list(char *ports_string)
 
1939
{
 
1940
  HttpConfigPortRange *ports_list = 0;
 
1941
 
 
1942
  if (!ports_string)
 
1943
    return (0);
 
1944
 
 
1945
  if (strchr(ports_string, '*')) {
 
1946
    ports_list = NEW(new HttpConfigPortRange);
 
1947
    ports_list->low = -1;
 
1948
    ports_list->high = -1;
 
1949
    ports_list->next = NULL;
 
1950
  } else {
 
1951
    HttpConfigPortRange *pr, *prev;
 
1952
    char *start;
 
1953
    char *end;
 
1954
 
 
1955
    pr = NULL;
 
1956
    prev = NULL;
 
1957
 
 
1958
    start = ports_string;
 
1959
 
 
1960
    while (1) {                 // eat whitespace
 
1961
      while ((start[0] != '\0') && ParseRules::is_space(start[0]))
 
1962
        start++;
 
1963
 
 
1964
      // locate the end of the next number
 
1965
      end = start;
 
1966
      while ((end[0] != '\0') && ParseRules::is_digit(end[0]))
 
1967
        end++;
 
1968
 
 
1969
      // if there is no next number we're done
 
1970
      if (start == end)
 
1971
        break;
 
1972
 
 
1973
      pr = NEW(new HttpConfigPortRange);
 
1974
      pr->low = atoi(start);
 
1975
      pr->high = pr->low;
 
1976
      pr->next = NULL;
 
1977
 
 
1978
      if (prev)
 
1979
        prev->next = pr;
 
1980
      else
 
1981
        ports_list = pr;
 
1982
      prev = pr;
 
1983
 
 
1984
      // if the next character after the current port
 
1985
      //  number is a dash then we are parsing a range
 
1986
      if (end[0] == '-') {
 
1987
        start = end + 1;
 
1988
        while ((start[0] != '\0') && ParseRules::is_space(start[0]))
 
1989
          start++;
 
1990
 
 
1991
        end = start;
 
1992
        while ((end[0] != '\0') && ParseRules::is_digit(end[0]))
 
1993
          end++;
 
1994
 
 
1995
        if (start == end)
 
1996
          break;
 
1997
 
 
1998
        pr->high = atoi(start);
 
1999
      }
 
2000
 
 
2001
      start = end;
 
2002
 
 
2003
      HTTP_ASSERT(pr->low <= pr->high);
 
2004
    }
 
2005
  }
 
2006
  return (ports_list);
 
2007
}
 
2008
 
 
2009
////////////////////////////////////////////////////////////////
 
2010
//
 
2011
//  HttpConfig::parse_url_expansions()
 
2012
//
 
2013
////////////////////////////////////////////////////////////////
 
2014
char **
 
2015
HttpConfig::parse_url_expansions(char *url_expansions_str, int *num_expansions)
 
2016
{
 
2017
  char **expansions = NULL;
 
2018
  int count = 0, i;
 
2019
 
 
2020
  if (!url_expansions_str) {
 
2021
    *num_expansions = count;
 
2022
    return expansions;
 
2023
  }
 
2024
  // First count the number of URL expansions in the string
 
2025
  char *start = url_expansions_str, *end;
 
2026
  while (1) {
 
2027
    // Skip whitespace
 
2028
    while (isspace(*start))
 
2029
      start++;
 
2030
    if (*start == '\0')
 
2031
      break;
 
2032
    count++;
 
2033
    end = start + 1;
 
2034
 
 
2035
    // Find end of expansion
 
2036
    while (!isspace(*end) && *end != '\0')
 
2037
      end++;
 
2038
    start = end;
 
2039
  }
 
2040
 
 
2041
  // Now extract the URL expansions
 
2042
  if (count) {
 
2043
    expansions = (char **) xmalloc(count * sizeof(char *));
 
2044
    start = url_expansions_str;
 
2045
    for (i = 0; i < count; i++) {
 
2046
      // Skip whitespace
 
2047
      while (isspace(*start))
 
2048
        start++;
 
2049
      expansions[i] = start;
 
2050
      end = start + 1;
 
2051
 
 
2052
      // Find end of expansion
 
2053
      while (!isspace(*end) && *end != '\0')
 
2054
        end++;
 
2055
      *end = '\0';
 
2056
      if (i < (count - 1))
 
2057
        start = end + 1;
 
2058
 
 
2059
    }
 
2060
  }
 
2061
 
 
2062
  *num_expansions = count;
 
2063
  return expansions;
 
2064
}
 
2065
 
 
2066
 
 
2067
////////////////////////////////////////////////////////////////
 
2068
//
 
2069
//  HttpConfig::cluster_delta_cb
 
2070
//
 
2071
////////////////////////////////////////////////////////////////
 
2072
void *
 
2073
HttpConfig::cluster_delta_cb(void *opaque_token, char *data_raw, int data_len)
 
2074
{
 
2075
  NOWARN_UNUSED(opaque_token);
 
2076
  NOWARN_UNUSED(data_len);
 
2077
  int32_t delta32 = (int32_t) atoi(data_raw);
 
2078
  int32_t old;
 
2079
 
 
2080
  // Using ink_atomic_swap is mostly paranoia since a thirty bit write
 
2081
  //  really ought to atomic.  However, any risk of bogus time is
 
2082
  //  too ugly for me to contemplate
 
2083
  old = ink_atomic_swap(&HttpConfig::m_master.cluster_time_delta, delta32);
 
2084
  Debug("http_trans", "Cluster time delta moving from %d to %d", old, delta32);
 
2085
 
 
2086
  return NULL;
 
2087
 
 
2088
}
 
2089
 
 
2090
volatile int32_t icp_dynamic_enabled;