Permalink
Browse files

TS-1685 Fix indentation before TS_MICRO removal

  • Loading branch information...
1 parent 1e0aba2 commit d779cf80fc5f9a9099ad7eb17b41aafff9cf75f8 @zwoop zwoop committed Jul 30, 2013
View
@@ -40,7 +40,7 @@ AC_PREREQ([2.59])
AC_CONFIG_AUX_DIR([build/aux])
AC_CONFIG_SRCDIR([proxy/Main.cc])
AC_CONFIG_MACRO_DIR([build])
-AM_INIT_AUTOMAKE([-Wall -Werror tar-ustar foreign no-installinfo no-installman 1.9.2])
+AM_INIT_AUTOMAKE([-Wall -Werror tar-ustar subdir-objects foreign no-installinfo no-installman 1.9.2])
AC_CONFIG_HEADERS([lib/ts/ink_autoconf.h])
# Configure with --disable-silent-rules to get verbose output. For more info, see
@@ -64,18 +64,18 @@ create_this_cluster_machine()
cluster_machine = NEW(new ClusterMachine);
}
-ClusterMachine::ClusterMachine(char *ahostname, unsigned int aip, int aport):
-dead(false),
-hostname(ahostname),
-ip(aip),
-cluster_port(aport),
-num_connections(0),
-now_connections(0),
-free_connections(0),
-rr_count(0),
-msg_proto_major(0),
-msg_proto_minor(0),
-clusterHandlers(0)
+ClusterMachine::ClusterMachine(char *ahostname, unsigned int aip, int aport)
+ : dead(false),
+ hostname(ahostname),
+ ip(aip),
+ cluster_port(aport),
+ num_connections(0),
+ now_connections(0),
+ free_connections(0),
+ rr_count(0),
+ msg_proto_major(0),
+ msg_proto_minor(0),
+ clusterHandlers(0)
{
EThread *thread = this_ethread();
ProxyMutex *mutex = thread->mutex;
@@ -131,8 +131,7 @@ clusterHandlers(0)
ip = aip;
ink_gethostbyaddr_r_data data;
- struct hostent *r = ink_gethostbyaddr_r((char *) &ip, sizeof(int),
- AF_INET, &data);
+ struct hostent *r = ink_gethostbyaddr_r((char *) &ip, sizeof(int), AF_INET, &data);
if (r == NULL) {
unsigned char x[4];
@@ -185,9 +184,11 @@ struct MachineTimeoutContinuation: public Continuation
(void) e;
delete m;
delete this;
- return EVENT_DONE;
+ return EVENT_DONE;
}
- MachineTimeoutContinuation(ClusterMachine * am):Continuation(NULL), m(am)
+
+ MachineTimeoutContinuation(ClusterMachine * am)
+ : Continuation(NULL), m(am)
{
SET_HANDLER((McTimeoutContHandler) & MachineTimeoutContinuation::dieEvent);
}
@@ -92,6 +92,7 @@ struct MachineListElement
unsigned int ip;
int port;
};
+
struct MachineList
{
int n;
@@ -59,9 +59,15 @@ extern int64_t default_large_iobuffer_size; // matched to size of OS buffers
#endif
enum AllocType
-{ NO_ALLOC, FAST_ALLOCATED, XMALLOCED, MEMALIGNED,
- DEFAULT_ALLOC, CONSTANT
+{
+ NO_ALLOC,
+ FAST_ALLOCATED,
+ XMALLOCED,
+ MEMALIGNED,
+ DEFAULT_ALLOC,
+ CONSTANT
};
+
#ifndef TS_MICRO
#if TS_USE_RECLAIMABLE_FREELIST
#define DEFAULT_BUFFER_NUMBER 64
@@ -59,7 +59,7 @@
class ClusterHandler; // Leave this a class - VC++ gets very anal ~SR
-struct Machine:Server
+struct Machine: Server
{
bool dead;
char *hostname;
@@ -91,6 +91,7 @@ struct MachineListElement
unsigned int ip;
int port;
};
+
struct MachineList
{
int n;
@@ -107,7 +108,7 @@ MachineList *read_MachineList(char *filename, int test_fd = -1);
void free_MachineList(MachineList * l);
#ifdef FIXME_CONFIG
-struct clusterConfigFile:configFile
+struct clusterConfigFile: configFile
{
#ifndef INK_NO_CLUSTER
char *parseFile(int fd)
View
@@ -45,7 +45,6 @@ configure_net(void)
static inline void
register_net_stats()
{
-
//
// Register statistics
//
@@ -59,76 +58,61 @@ register_net_stats()
RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.write_bytes",
RECD_INT, RECP_NULL, (int) net_write_bytes_stat, RecRawStatSyncSum);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.connections_currently_open",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.connections_currently_open",
RECD_INT, RECP_NON_PERSISTENT, (int) net_connections_currently_open_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_connections_currently_open_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.accepts_currently_open",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.accepts_currently_open",
RECD_INT, RECP_NON_PERSISTENT, (int) net_accepts_currently_open_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_accepts_currently_open_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_readfromnet",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_readfromnet",
RECD_INT, RECP_NULL, (int) net_calls_to_readfromnet_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_readfromnet_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_readfromnet_afterpoll",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_readfromnet_afterpoll",
RECD_INT, RECP_NULL, (int) net_calls_to_readfromnet_afterpoll_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_readfromnet_afterpoll_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_read",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_read",
RECD_INT, RECP_NULL, (int) net_calls_to_read_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_read_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_read_nodata",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_read_nodata",
RECD_INT, RECP_NULL, (int) net_calls_to_read_nodata_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_read_nodata_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_writetonet",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_writetonet",
RECD_INT, RECP_NULL, (int) net_calls_to_writetonet_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_writetonet_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_writetonet_afterpoll",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_writetonet_afterpoll",
RECD_INT, RECP_NULL, (int) net_calls_to_writetonet_afterpoll_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_writetonet_afterpoll_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_write",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_write",
RECD_INT, RECP_NULL, (int) net_calls_to_write_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_write_stat);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.calls_to_write_nodata",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_write_nodata",
RECD_INT, RECP_NULL, (int) net_calls_to_write_nodata_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_write_nodata_stat);
#ifndef INK_NO_SOCKS
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.socks.connections_successful",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_successful",
RECD_INT, RECP_NULL, (int) socks_connections_successful_stat, RecRawStatSyncSum);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.socks.connections_unsuccessful",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_unsuccessful",
RECD_INT, RECP_NULL, (int) socks_connections_unsuccessful_stat, RecRawStatSyncSum);
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.socks.connections_currently_open",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_currently_open",
RECD_INT, RECP_NON_PERSISTENT, (int) socks_connections_currently_open_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(socks_connections_currently_open_stat);
#endif
- RecRegisterRawStat(net_rsb, RECT_PROCESS,
- "proxy.process.net.inactivity_cop_lock_acquire_failure",
+ RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.inactivity_cop_lock_acquire_failure",
RECD_INT, RECP_NULL, (int) inactivity_cop_lock_acquire_failure_stat,
RecRawStatSyncSum);
-
}
void
View
@@ -94,7 +94,7 @@ struct CC_FreerContinuation: public Continuation
Debug("cache_control", "Deleting old table");
delete p;
delete this;
- return EVENT_DONE;
+ return EVENT_DONE;
}
CC_FreerContinuation(CC_table * ap):Continuation(NULL), p(ap)
{
@@ -114,7 +114,7 @@ struct CC_UpdateContinuation: public Continuation
{
reloadCacheControl();
delete this;
- return EVENT_DONE;
+ return EVENT_DONE;
}
CC_UpdateContinuation(ProxyMutex * m):Continuation(m)
{
@@ -208,6 +208,7 @@ getClusterCacheLocal(URL *url, char * /* hostname ATS_UNUSED */)
req_hdr.clear();
return result.cluster_cache_local;
}
+
//
// End API functions
//
@@ -221,7 +222,8 @@ void
CacheControlResult::Print()
{
printf("\t reval: %d, never-cache: %d, pin: %d, cluster-cache-c: %d ignore-c: %d ignore-s: %d\n",
- revalidate_after, never_cache, pin_in_cache_for, cluster_cache_local, ignore_client_no_cache, ignore_server_no_cache);
+ revalidate_after, never_cache, pin_in_cache_for, cluster_cache_local, ignore_client_no_cache,
+ ignore_server_no_cache);
}
// void CacheControlRecord::Print()
@@ -247,7 +249,6 @@ CacheControlRecord::Print()
case CC_NEVER_CACHE:
case CC_STANDARD_CACHE:
case CC_IGNORE_NO_CACHE:
- // case CC_CACHE_AUTH_CONTENT:
printf("\t\tDirective: %s\n", CC_directive_str[this->directive]);
break;
case CC_INVALID:
@@ -296,10 +297,8 @@ CacheControlRecord::Init(matcher_line * line_info)
int v = strtol(val, &ptr, 0);
if (!ptr || v < 0 || v > 4) {
errBuf = static_cast<char*>(ats_malloc(errBufLen * sizeof(char)));
- snprintf(errBuf, errBufLen,
- "Value for " TWEAK_CACHE_RESPONSES_TO_COOKIES
- " must be an integer in the range 0..4"
- );
+ snprintf(errBuf, errBufLen, "Value for " TWEAK_CACHE_RESPONSES_TO_COOKIES
+ " must be an integer in the range 0..4");
return errBuf;
} else {
cache_responses_to_cookies = v;
@@ -342,9 +341,6 @@ CacheControlRecord::Init(matcher_line * line_info)
} else if (strcasecmp(val, "ignore-server-no-cache") == 0) {
directive = CC_IGNORE_SERVER_NO_CACHE;
d_found = true;
- //} else if (strcasecmp(val, "cache-auth-content") == 0) {
- // directive = CC_CACHE_AUTH_CONTENT;
- // d_found = true;
} else {
errBuf = (char *)ats_malloc(errBufLen * sizeof(char));
snprintf(errBuf, errBufLen, "%s Invalid action at line %d in cache.config", modulePrefix, line_num);
@@ -481,13 +477,6 @@ CacheControlRecord::UpdateMatch(CacheControlResult * result, RequestData * rdata
match = true;
}
break;
-// case CC_CACHE_AUTH_CONTENT:
- // if (this->CheckForMatch(h_rdata, result->cache_auth_line) == true) {
- // result->cache_auth_content = true;
- // result->cache_auth_line = this->line_num;
- // match = true;
- // }
- // break;
case CC_INVALID:
case CC_NUM_TYPES:
default:
@@ -504,14 +493,12 @@ CacheControlRecord::UpdateMatch(CacheControlResult * result, RequestData * rdata
char crtc_debug[80];
if (result->cache_responses_to_cookies >= 0)
snprintf(crtc_debug, sizeof(crtc_debug), " [" TWEAK_CACHE_RESPONSES_TO_COOKIES "=%d]",
- result->cache_responses_to_cookies
- );
+ result->cache_responses_to_cookies);
else
crtc_debug[0] = 0;
- Debug("cache_control", "Matched with for %s at line %d%s",
- CC_directive_str[this->directive], this->line_num, crtc_debug
- );
+ Debug("cache_control", "Matched with for %s at line %d%s", CC_directive_str[this->directive],
+ this->line_num, crtc_debug);
}
}
#else
View
@@ -54,7 +54,6 @@ enum CacheControlType
CC_IGNORE_NO_CACHE,
CC_CLUSTER_CACHE_LOCAL,
CC_IGNORE_CLIENT_NO_CACHE,
- //CC_IGNORE_SERVER_NO_CACHE,CC_PIN_IN_CACHE, CC_TTL_IN_CACHE, CC_CACHE_AUTH_CONTENT, CC_NUM_TYPES
CC_IGNORE_SERVER_NO_CACHE,
CC_PIN_IN_CACHE,
CC_TTL_IN_CACHE,
@@ -83,7 +82,6 @@ class CacheControlResult
bool ignore_server_no_cache;
bool ignore_client_cc_max_age;
int cache_responses_to_cookies; ///< Override for caching cookied responses.
-// bool cache_auth_content;
// Data for internal use only
//
@@ -100,7 +98,6 @@ class CacheControlResult
int cluster_cache_local_line;
int ignore_client_line;
int ignore_server_line;
- // int cache_auth_line;
};
inline
@@ -114,15 +111,13 @@ CacheControlResult::CacheControlResult()
ignore_server_no_cache(false),
ignore_client_cc_max_age(true),
cache_responses_to_cookies(-1), // do not change value
- //cache_auth_content(false),
reval_line(-1),
never_line(-1),
pin_line(-1),
ttl_line(-1),
cluster_cache_local_line(-1),
ignore_client_line(-1),
ignore_server_line(-1)
- //cache_auth_line(-1)
{ }
class CacheControlRecord : public ControlBase
@@ -139,9 +134,8 @@ class CacheControlRecord : public ControlBase
inline
CacheControlRecord::CacheControlRecord()
- : ControlBase(), directive(CC_INVALID), time_arg(0)
- , cache_responses_to_cookies(-1)
-{}
+ : ControlBase(), directive(CC_INVALID), time_arg(0) , cache_responses_to_cookies(-1)
+{ }
//
// API to outside world
@@ -158,4 +152,5 @@ inkcoreapi bool ip_rule_in_CacheControlTable();
void initCacheControl();
void reloadCacheControl();
-#endif
+
+#endif /* _CACHE_CONTROL_H_ */
Oops, something went wrong.

0 comments on commit d779cf8

Please sign in to comment.