[2/2] trafficserver git commit: Add TS-3537 to CHANGES

2015-05-01 Thread zwoop
Add TS-3537 to CHANGES


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b00cb7bf
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b00cb7bf
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b00cb7bf

Branch: refs/heads/master
Commit: b00cb7bf151846ab7b182c4d4bdf709ead39f8c9
Parents: 4afa996
Author: Leif Hedstrom zw...@apache.org
Authored: Fri May 1 19:19:59 2015 -0600
Committer: Leif Hedstrom zw...@apache.org
Committed: Fri May 1 19:22:04 2015 -0600

--
 CHANGES | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b00cb7bf/CHANGES
--
diff --git a/CHANGES b/CHANGES
index 7ca2390..ecf0af0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,11 +1,14 @@
  -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
 
-  *) [TS-3531] Ignore blank lines in the plugin config file
+  *) [TS-3537] Make 32-bit platforms build error, overridable with
+   --enable-32bit-build.
+
+  *) [TS-3531] Ignore blank lines in the plugin config file.
 
   *) [TS-3539] Close excess file descriptors in crash log helper.
 
-  *) [TS-3576] Remove the need for FIPS locking for OpenSSL
+  *) [TS-3576] Remove the need for FIPS locking for OpenSSL.
 
   *) [TS-3538] Perform server certificate validity check.
 



trafficserver git commit: TS-2490 TS-3554 TS-3558 TS-3549 clang-format ...

2015-05-01 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/master fc8eeb6e4 - 0eb34ce6a


TS-2490 TS-3554 TS-3558 TS-3549 clang-format ...


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0eb34ce6
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0eb34ce6
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0eb34ce6

Branch: refs/heads/master
Commit: 0eb34ce6a52fa02d19ec2fda42bb86a898f5351a
Parents: fc8eeb6
Author: Leif Hedstrom zw...@apache.org
Authored: Fri May 1 22:14:14 2015 -0600
Committer: Leif Hedstrom zw...@apache.org
Committed: Fri May 1 22:14:14 2015 -0600

--
 cmd/traffic_cop/traffic_cop.cc  |   2 +-
 iocore/net/SSLCertLookup.cc |   2 +-
 iocore/net/SSLUtils.cc  | 116 +--
 lib/atscppapi/src/Transaction.cc|   3 +-
 .../src/include/atscppapi/Transaction.h |   8 +-
 .../background_fetch/background_fetch.cc|   5 +-
 proxy/InkAPITest.cc |   3 +-
 proxy/hdrs/HdrToken.cc  |   4 +-
 proxy/http/HttpSM.cc|  23 ++--
 proxy/http/HttpTransact.cc  |   5 +-
 10 files changed, 82 insertions(+), 89 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0eb34ce6/cmd/traffic_cop/traffic_cop.cc
--
diff --git a/cmd/traffic_cop/traffic_cop.cc b/cmd/traffic_cop/traffic_cop.cc
index 4b68870..1a9ebad 100644
--- a/cmd/traffic_cop/traffic_cop.cc
+++ b/cmd/traffic_cop/traffic_cop.cc
@@ -107,7 +107,7 @@ static int server_failures = 0;
 static int server_not_found = 0;
 
 static const int sleep_time = 10;  // 10 sec
-static int init_sleep_time  = sleep_time;  // 10 sec
+static int init_sleep_time = sleep_time;   // 10 sec
 static const int manager_timeout = 3 * 60; //  3 min
 static const int server_timeout = 3 * 60;  //  3 min
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0eb34ce6/iocore/net/SSLCertLookup.cc
--
diff --git a/iocore/net/SSLCertLookup.cc b/iocore/net/SSLCertLookup.cc
index 071b2db..d6b76bc 100644
--- a/iocore/net/SSLCertLookup.cc
+++ b/iocore/net/SSLCertLookup.cc
@@ -159,7 +159,7 @@ ticket_block_alloc(unsigned count)
   return ptr;
 }
 
-void 
+void
 SSLCertContext::release()
 {
   if (keyblock) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0eb34ce6/iocore/net/SSLUtils.cc
--
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 881ca2f..1d61a8a 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -1168,69 +1168,68 @@ SSLPrivateKeyHandler(SSL_CTX *ctx, const 
SSLConfigParams *params, const ats_scop
 static int
 SSLCheckServerCertNow(const char *certFilename)
 {
-BIO*bioFP = NULL;
-X509   *myCert;
-inttimeCmpValue;
-time_t currentTime;
-
-// SSLCheckServerCertNow() -  returns 0 on OK or negative value on failure
-// and update log as appropriate.
-// Will check:
-// - if file exists, and has read permissions 
-// - for truncation or other PEM read fail 
-// - current time is between notBefore and notAfter dates of certificate
-// if anything is not kosher, a negative value is returned and appropriate 
error logged.
-
-if ((!certFilename) || (!(*certFilename))) { 
-return -2;
-}
+  BIO *bioFP = NULL;
+  X509 *myCert;
+  int timeCmpValue;
+  time_t currentTime;
 
-if ((bioFP = BIO_new(BIO_s_file())) == NULL) {
-Error(BIO_new() failed for server certificate check.  Out of 
memory?);
-return -1;
-}
+  // SSLCheckServerCertNow() -  returns 0 on OK or negative value on failure
+  // and update log as appropriate.
+  // Will check:
+  // - if file exists, and has read permissions
+  // - for truncation or other PEM read fail
+  // - current time is between notBefore and notAfter dates of certificate
+  // if anything is not kosher, a negative value is returned and appropriate 
error logged.
 
-if (BIO_read_filename(bioFP, certFilename) = 0) {
-// file not found, or not accessible due to permissions
-Error(Can't open server certificate file: \%s\\n,certFilename);
-BIO_free(bioFP);
-return -2;
-}
+  if ((!certFilename) || (!(*certFilename))) {
+return -2;
+  }
 
-myCert = PEM_read_bio_X509(bioFP, NULL, 0, NULL);
+  if ((bioFP = BIO_new(BIO_s_file())) == NULL) {
+Error(BIO_new() failed for server certificate check.  Out of memory?);
+return -1;
+  }
+
+  if (BIO_read_filename(bioFP, certFilename) = 0) {
+// file not found, or not accessible due to permissions
+Error(Can't open 

[1/2] trafficserver git commit: TS-3484 Make inactivity_cop frequency (schedule) configurable

2015-05-01 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/master 566194cc9 - fc8eeb6e4


TS-3484 Make inactivity_cop frequency (schedule) configurable


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ad77de62
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ad77de62
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ad77de62

Branch: refs/heads/master
Commit: ad77de622bfd717efbd279bdb0cc1315a6fa78a9
Parents: 566194c
Author: Leif Hedstrom zw...@apache.org
Authored: Fri Apr 3 09:04:19 2015 -0600
Committer: Leif Hedstrom zw...@apache.org
Committed: Fri May 1 20:51:00 2015 -0600

--
 doc/reference/configuration/records.config.en.rst | 6 ++
 iocore/net/UnixNet.cc | 7 ++-
 mgmt/RecordsConfig.cc | 2 ++
 3 files changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ad77de62/doc/reference/configuration/records.config.en.rst
--
diff --git a/doc/reference/configuration/records.config.en.rst 
b/doc/reference/configuration/records.config.en.rst
index 9243747..a9a2c68 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -303,6 +303,12 @@ Network
`proxy.process.net.default_inactivity_timeout_applied` metric
is incremented.
 
+.. ts:cv:: CONFIG proxy.config.net.inactivity_check_frequency INT 1
+
+   How frequent (in seconds) to check for inactive connections. If you deal
+   with a lot of concurrent connections, increasing this setting can reduce
+   pressure on the system.
+
 .. ts:cv:: LOCAL proxy.local.incoming_ip_to_bind STRING 0.0.0.0 [::]
 
Controls the global default IP addresses to which to bind proxy server 
ports. The value is a space separated list of IP addresses, one per supported 
IP address family (currently IPv4 and IPv6).

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ad77de62/iocore/net/UnixNet.cc
--
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index 03c3bec..7ffefff 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -61,6 +61,8 @@ public:
 (void)event;
 ink_hrtime now = ink_get_hrtime();
 NetHandler nh = *get_NetHandler(this_ethread());
+
+Debug(inactivity_cop_check, Checking inactivity on Thread-ID #%d, 
this_ethread()-id);
 total_connections_in = 0;
 // Copy the list and use pop() to catch any closes caused by callbacks.
 forl_LL(UnixNetVConnection, vc, nh.open_list)
@@ -367,7 +369,10 @@ initialize_thread_for_net(EThread *thread)
 
 #ifndef INACTIVITY_TIMEOUT
   InactivityCop *inactivityCop = new 
InactivityCop(get_NetHandler(thread)-mutex);
-  thread-schedule_every(inactivityCop, HRTIME_SECONDS(1));
+  int cop_freq = 1;
+
+  REC_ReadConfigInteger(cop_freq, 
proxy.config.net.inactivity_check_frequency);
+  thread-schedule_every(inactivityCop, HRTIME_SECONDS(cop_freq));
 #endif
 
   thread-signal_hook = net_signal_hook_function;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ad77de62/mgmt/RecordsConfig.cc
--
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index aa499dc..c655c20 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -826,6 +826,8 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, proxy.config.net.default_inactivity_timeout, RECD_INT, 
86400, RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, proxy.config.net.inactivity_check_frequency, RECD_INT, 1, 
RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
 
   
//##
   //#



[1/2] trafficserver git commit: TS-3392 Fix static initialization order, for OSX

2015-05-01 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/master b00cb7bf1 - 566194cc9


TS-3392 Fix static initialization order, for OSX


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/303010e9
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/303010e9
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/303010e9

Branch: refs/heads/master
Commit: 303010e92627fe9561de780c1efbd8f01e3bdf44
Parents: b00cb7b
Author: Bin Zeng bz...@linkedin.com
Authored: Fri May 1 19:24:36 2015 -0600
Committer: Leif Hedstrom zw...@apache.org
Committed: Fri May 1 19:24:36 2015 -0600

--
 lib/ts/Arena.cc | 3 +++
 lib/ts/ink_mutex.cc | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/303010e9/lib/ts/Arena.cc
--
diff --git a/lib/ts/Arena.cc b/lib/ts/Arena.cc
index 6ab9bdb..a67f2fe 100644
--- a/lib/ts/Arena.cc
+++ b/lib/ts/Arena.cc
@@ -21,6 +21,7 @@
   limitations under the License.
  */
 
+#include ink_mutex.h
 #include libts.h
 #include assert.h
 #include string.h
@@ -29,6 +30,8 @@
 #define DEFAULT_ALLOC_SIZE 1024
 #define DEFAULT_BLOCK_SIZE (DEFAULT_ALLOC_SIZE - (sizeof(ArenaBlock) - 8))
 
+// Define the _g_mattr first to avoid static initialization order fiasco.
+x_pthread_mutexattr_t _g_mattr;
 
 static Allocator defaultSizeArenaBlock(ArenaBlock, DEFAULT_ALLOC_SIZE);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/303010e9/lib/ts/ink_mutex.cc
--
diff --git a/lib/ts/ink_mutex.cc b/lib/ts/ink_mutex.cc
index 9036f55..98cc70a 100644
--- a/lib/ts/ink_mutex.cc
+++ b/lib/ts/ink_mutex.cc
@@ -27,6 +27,4 @@
 #include stdio.h
 #include ink_mutex.h
 
-x_pthread_mutexattr_t _g_mattr;
-
 ink_mutex __global_death = PTHREAD_MUTEX_INITIALIZER;



[2/2] trafficserver git commit: Added TS-3392 to CHANGES.

2015-05-01 Thread zwoop
Added TS-3392 to CHANGES.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/566194cc
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/566194cc
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/566194cc

Branch: refs/heads/master
Commit: 566194cc9a418c5f3d0a29e74e251e117e9d10a4
Parents: 303010e
Author: Leif Hedstrom zw...@apache.org
Authored: Fri May 1 19:25:21 2015 -0600
Committer: Leif Hedstrom zw...@apache.org
Committed: Fri May 1 19:25:21 2015 -0600

--
 CHANGES | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/566194cc/CHANGES
--
diff --git a/CHANGES b/CHANGES
index ecf0af0..1cc0ac1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
  -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
 
+  *) [TS-3392] Fix static initialization order, for OSX.
+   Author: Bin Zeng bz...@linkedin.com
+
   *) [TS-3537] Make 32-bit platforms build error, overridable with
--enable-32bit-build.
 



trafficserver git commit: Adding new API to C++ api for Cache Status

2015-05-01 Thread briang
Repository: trafficserver
Updated Branches:
  refs/heads/master 31c544114 - 523b47493


Adding new API to C++ api for Cache Status


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/523b4749
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/523b4749
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/523b4749

Branch: refs/heads/master
Commit: 523b47493b446bcacb69102cbb6b9e9a498b584d
Parents: 31c5441
Author: Brian Geffon bri...@apache.org
Authored: Thu Apr 30 11:07:42 2015 -0700
Committer: Brian Geffon bri...@apache.org
Committed: Thu Apr 30 11:07:42 2015 -0700

--
 lib/atscppapi/src/Transaction.cc| 23 
 .../src/include/atscppapi/Transaction.h | 13 +++
 2 files changed, 36 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/523b4749/lib/atscppapi/src/Transaction.cc
--
diff --git a/lib/atscppapi/src/Transaction.cc b/lib/atscppapi/src/Transaction.cc
index 4ff6319..9254d8c 100644
--- a/lib/atscppapi/src/Transaction.cc
+++ b/lib/atscppapi/src/Transaction.cc
@@ -303,6 +303,29 @@ Transaction::setTimeout(Transaction::TimeoutType type, int 
time_ms)
   }
 }
 
+
+Transaction::CacheStatus
+Transaction::getCacheStatus() {
+  int obj_status = TS_ERROR;
+
+  if (TSHttpTxnCacheLookupStatusGet(state_-txn_, obj_status) == TS_ERROR) {
+return CACHE_LOOKUP_NONE;
+  }
+
+  switch (obj_status) {
+  case TS_CACHE_LOOKUP_MISS:
+return CACHE_LOOKUP_MISS;
+  case TS_CACHE_LOOKUP_HIT_STALE:
+return CACHE_LOOKUP_HIT_STALE;
+  case TS_CACHE_LOOKUP_HIT_FRESH:
+return CACHE_LOOKUP_HIT_FRESH;
+  case TS_CACHE_LOOKUP_SKIPPED:
+return CACHE_LOOKUP_SKIPED;
+  default:
+return CACHE_LOOKUP_NONE;
+  }
+}
+
 void
 Transaction::redirectTo(std::string const url)
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/523b4749/lib/atscppapi/src/include/atscppapi/Transaction.h
--
diff --git a/lib/atscppapi/src/include/atscppapi/Transaction.h 
b/lib/atscppapi/src/include/atscppapi/Transaction.h
index a0d7bf7..39454b0 100644
--- a/lib/atscppapi/src/include/atscppapi/Transaction.h
+++ b/lib/atscppapi/src/include/atscppapi/Transaction.h
@@ -255,6 +255,19 @@ public:
   void setTimeout(TimeoutType type, int time_ms);
 
   /**
+   * Represents different states of an object served out of the cache
+   */
+  enum CacheStatus {
+CACHE_LOOKUP_MISS = 0,  /** The object was not found in the cache */
+CACHE_LOOKUP_HIT_STALE, /** The object was found in cache but stale */
+CACHE_LOOKUP_HIT_FRESH, /** The object was found in cache and was 
fresh */
+CACHE_LOOKUP_SKIPED,/** Cache lookup was not performed */
+CACHE_LOOKUP_NONE
+  };
+
+  CacheStatus getCacheStatus();
+
+  /**
* Returns the TSHttpTxn related to the current Transaction
*
* @return a void * which can be cast back to a TSHttpTxn.



[2/2] trafficserver git commit: Fix CHANGES formatting

2015-05-01 Thread jpeach
Fix CHANGES formatting


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4a450721
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4a450721
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4a450721

Branch: refs/heads/master
Commit: 4a4507216354833ba39140a78d4cf10357f6e582
Parents: a5c2625
Author: James Peach jpe...@apache.org
Authored: Fri May 1 09:08:02 2015 -0700
Committer: James Peach jpe...@apache.org
Committed: Fri May 1 09:08:02 2015 -0700

--
 CHANGES | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4a450721/CHANGES
--
diff --git a/CHANGES b/CHANGES
index be3ddcd..6c88873 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,13 +5,13 @@ Changes with Apache Traffic Server 6.0.0
 
   *) [TS-3576] Remove the need for FIPS locking for OpenSSL
 
-  *) [TS-3538]: Perform server certificate validity check.
+  *) [TS-3538] Perform server certificate validity check.
 
   *) [TS-3575] Fix connection leak.
 
   *) [TS-3538] Perform server certificate validity check.
 
-  *) [TS-3549] Configurable option to avoid thundering herd problem 
+  *) [TS-3549] Configurable option to avoid thundering herd problem
for multiple concurrent requests. The initial POC patch for this
solution came from Justin Laue. This patch will further be
improved with a few more changes to possibly support SWR feature in
@@ -122,7 +122,6 @@ Changes with Apache Traffic Server 6.0.0
 
   *) [TS-3456] SSL blind tunnel sometimes not created.
 
-
 Changes with Apache Traffic Server 5.3.0
 
   *) [TS-3468] Make command 'check' work usefully.
@@ -409,7 +408,6 @@ Changes with Apache Traffic Server 5.3.0
   *) [TS-1570] Remap doesn't reject request with extract characters after port
  in Host header. Author: Cynthia Gu czhen...@linkedin.com
 
-
 Changes with Apache Traffic Server 5.2.0
 
   *) [TS-3280] Segfault in new freelist bulk freeing (in debug mode).



[1/2] trafficserver git commit: [TS-3531]: Ignore blank lines in the plugin config file

2015-05-01 Thread sudheerv
Repository: trafficserver
Updated Branches:
  refs/heads/master 4a4507216 - 3eb7c1e7e


[TS-3531]: Ignore blank lines in the plugin config file


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f39aaba1
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f39aaba1
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f39aaba1

Branch: refs/heads/master
Commit: f39aaba197a4f4d6559a94aa5b8ffa5dcfc3c3b6
Parents: 4a45072
Author: Sudheer Vinukonda sudhe...@yahoo-inc.com
Authored: Fri May 1 21:40:27 2015 +
Committer: Sudheer Vinukonda sudhe...@yahoo-inc.com
Committed: Fri May 1 21:40:27 2015 +

--
 plugins/cacheurl/cacheurl.cc | 25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f39aaba1/plugins/cacheurl/cacheurl.cc
--
diff --git a/plugins/cacheurl/cacheurl.cc b/plugins/cacheurl/cacheurl.cc
index e01407d..5f03598 100644
--- a/plugins/cacheurl/cacheurl.cc
+++ b/plugins/cacheurl/cacheurl.cc
@@ -236,17 +236,23 @@ load_config_file(const char *config_file)
 
   while (TSfgets(fh, buffer, sizeof(buffer) - 1)) {
 lineno++;
-if (*buffer == '#') {
-  /* # Comments, only at line beginning */
+
+// make sure line was not bigger than buffer
+if ((eol = strchr(buffer, '\n')) == NULL  (eol = strstr(buffer, \r\n)) 
== NULL) {
+  // Malformed line - skip
+  TSError(%s: config line too long, did not get a good line in cfg, 
skipping, line: %s, PLUGIN_NAME, buffer);
+  memset(buffer, 0, sizeof(buffer));
   continue;
-}
-eol = strstr(buffer, \n);
-if (eol) {
-  *eol = 0; /* Terminate string at newline */
 } else {
-  /* Malformed line - skip */
+  *eol = 0;
+}
+// make sure line has something useful on it
+// or allow # Comments, only at line beginning
+if (eol - buffer  2 || buffer[0] == '#') {
+  memset(buffer, 0, sizeof(buffer));
   continue;
 }
+
 /* Split line into two parts based on whitespace */
 /* Find first whitespace */
 spstart = strstr(buffer,  );
@@ -434,6 +440,7 @@ TSPluginInit(int argc, const char *argv[])
   info.support_email = (char *)d...@trafficserver.apache.org;
 
   if (TSPluginRegister(TS_SDK_VERSION_3_0, info) != TS_SUCCESS) {
+TSDebug(PLUGIN_NAME, ERROR, Plugin registration failed);
 initialization_error(Plugin registration failed.);
 return;
   }
@@ -444,5 +451,9 @@ TSPluginInit(int argc, const char *argv[])
 /* Store the pattern replacement list in the continuation */
 TSContDataSet(contp, prl);
 TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, contp);
+  } else {
+TSDebug(PLUGIN_NAME, ERROR, Plugin config load failed.);
+initialization_error(Plugin config load failed.);
+return;
   }
 }



[2/2] trafficserver git commit: update CHANGES

2015-05-01 Thread sudheerv
update CHANGES


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3eb7c1e7
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3eb7c1e7
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3eb7c1e7

Branch: refs/heads/master
Commit: 3eb7c1e7e5cbccb70990c0f7fbbee6c39442cb72
Parents: f39aaba
Author: Sudheer Vinukonda sudhe...@yahoo-inc.com
Authored: Fri May 1 21:41:14 2015 +
Committer: Sudheer Vinukonda sudhe...@yahoo-inc.com
Committed: Fri May 1 21:41:14 2015 +

--
 CHANGES | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3eb7c1e7/CHANGES
--
diff --git a/CHANGES b/CHANGES
index 6c88873..7ca2390 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
  -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
 
+  *) [TS-3531] Ignore blank lines in the plugin config file
+
   *) [TS-3539] Close excess file descriptors in crash log helper.
 
   *) [TS-3576] Remove the need for FIPS locking for OpenSSL