[trafficserver] 02/02: FD leaks when ep.start() failed or cancelled in acceptEvent or con.connect() failed

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit a2131ea016bc6e3559f71615dabf4dff32e9571f
Author: Oknet Xu 
AuthorDate: Wed Aug 30 18:32:24 2017 +0800

FD leaks when ep.start() failed or cancelled in acceptEvent or 
con.connect() failed

(cherry picked from commit 9ded874c82de732d2c2d42c2b633d7e94adcb2e7)

 Conflicts:
iocore/net/UnixNetVConnection.cc
---
 iocore/net/SSLNetVConnection.cc  | 1 -
 iocore/net/UnixNetVConnection.cc | 8 +---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 53d7012..9b389a2 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -892,7 +892,6 @@ SSLNetVConnection::free(EThread *t)
 
   closed = 0;
   options.reset();
-  con.close();
 
   ink_assert(con.fd == NO_FD);
 
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index fc6967a..051fcec 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -94,7 +94,6 @@ close_UnixNetVConnection(UnixNetVConnection *vc, EThread *t)
   NetHandler *nh = vc->nh;
   vc->cancel_OOB();
   vc->ep.stop();
-  vc->con.close();
 
   ink_release_assert(vc->thread == t);
 
@@ -1154,14 +1153,14 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
 
   SET_HANDLER((NetVConnHandler)::mainEvent);
 
-  nh = get_NetHandler(thread);
   PollDescriptor *pd = get_PollDescriptor(thread);
   if (ep.start(pd, this, EVENTIO_READ | EVENTIO_WRITE) < 0) {
 Debug("iocore_net", "acceptEvent : failed EventIO::start");
-close_UnixNetVConnection(this, e->ethread);
+free(t);
 return EVENT_DONE;
   }
 
+  nh = get_NetHandler(thread);
   set_inactivity_timeout(0);
   nh->open_list.enqueue(this);
 
@@ -1396,6 +1395,9 @@ void
 UnixNetVConnection::free(EThread *t)
 {
   ink_release_assert(t == this_ethread());
+
+  // close socket fd
+  con.close();
   // clear variables for reuse
   this->mutex.clear();
   action_.mutex.clear();

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] branch 7.1.x updated: Updated CHANGELOG

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
 new 6189b59  Updated CHANGELOG
6189b59 is described below

commit 6189b5904c7960a964eda0995d94c5522759050d
Author: Leif Hedstrom 
AuthorDate: Wed Aug 30 18:30:02 2017 -0600

Updated CHANGELOG
---
 CHANGELOG-7.1.1 | 9 +
 1 file changed, 9 insertions(+)

diff --git a/CHANGELOG-7.1.1 b/CHANGELOG-7.1.1
index ba78f46..6f224fb 100644
--- a/CHANGELOG-7.1.1
+++ b/CHANGELOG-7.1.1
@@ -1,5 +1,6 @@
 Changes with Apache Traffic Server 7.1.1
   #1766 - Can't convert Cache Result to Cache MISS by 
TSHttpTxnCacheLookupStatusSet
+  #1953 - Unit Tests for Issue #1605 AWS Signature Version 4
   #1980 - Issue #1685: Use TS_MILESTONE_UA_BEGIN for cqt* log fields
   #2123 - ua_buffer_reader should be released in deallocate_redirect_postdata
   #2217 - Be less aggressive in calling SSL_shutdown.
@@ -17,3 +18,11 @@ Changes with Apache Traffic Server 7.1.1
   #2396 - Fedora 26 and gcc7 support for ATS 7.1.1
   #2401 - Prefer setting AM_CPPFLAGS vs. CPPFLAGS, etc.
   #2402 - Added more fallthrough comments for Fedora 26 and gcc7 for ICP
+  #2413 - Correctly Handle EVENT_NONE in UnixNetVConnection::acceptEvent
+  #2414 - Out-of-bounds while get port from host field
+  #2443 - AWS auth v4: fixed query param value URI-encoding
+  #2452 - Ticket file reload shouldn't kill traffic_server process
+  #2453 - FD leaks when ep.start() failed or cancelled in acceptEvent or 
con.connect() failed
+  #2457 - Cherry pick a set of Catch based commits to 7.1
+  #2458 - Coverity: CID 1380042:Resource leaks  (RESOURCE_LEAK)
+  #2460 - S3_auth:uri(En|De)code() pass by ref,not val(master)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch 7.1.x updated (9e53eac -> a2131ea)

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 9e53eac  S3_auth:uri(En|De)code() pass by ref,not val(master)
 new 059dc2f  Correctly Handle EVENT_NONE in UnixNetVConnection::acceptEvent
 new a2131ea  FD leaks when ep.start() failed or cancelled in acceptEvent 
or con.connect() failed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 iocore/net/SSLNetVConnection.cc  |  1 -
 iocore/net/UnixNetVConnection.cc | 16 ++--
 2 files changed, 10 insertions(+), 7 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] 01/02: Correctly Handle EVENT_NONE in UnixNetVConnection::acceptEvent

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 059dc2fa2edc00e0f5b8f773b89b48616409bf31
Author: Oknet Xu 
AuthorDate: Tue Aug 22 15:03:39 2017 +0800

Correctly Handle EVENT_NONE in UnixNetVConnection::acceptEvent

(cherry picked from commit a32f7ed3e49f595633f59cc44481f42af01f7a58)
---
 iocore/net/UnixNetVConnection.cc | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index c914f6c..fc6967a 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -1132,12 +1132,12 @@ UnixNetVConnection::startEvent(int /* event ATS_UNUSED 
*/, Event *e)
 int
 UnixNetVConnection::acceptEvent(int event, Event *e)
 {
-  thread = e->ethread;
+  EThread *t = (e == nullptr) ? this_ethread() : e->ethread;
 
-  MUTEX_TRY_LOCK(lock, get_NetHandler(thread)->mutex, e->ethread);
+  MUTEX_TRY_LOCK(lock, get_NetHandler(t)->mutex, t);
   if (!lock.is_locked()) {
 if (event == EVENT_NONE) {
-  thread->schedule_in(this, HRTIME_MSECONDS(net_retry_delay));
+  t->schedule_in(this, HRTIME_MSECONDS(net_retry_delay));
   return EVENT_DONE;
 } else {
   e->schedule_in(HRTIME_MSECONDS(net_retry_delay));
@@ -1145,6 +1145,8 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
 }
   }
 
+  thread = t;
+
   if (action_.cancelled) {
 free(thread);
 return EVENT_DONE;

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] branch 7.1.x updated: S3_auth:uri(En|De)code() pass by ref, not val(master)

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
 new 9e53eac  S3_auth:uri(En|De)code() pass by ref,not val(master)
9e53eac is described below

commit 9e53eac7053938d3d0710373456f3c6f88f361d8
Author: Gancho Tenev 
AuthorDate: Wed Aug 30 15:43:49 2017 -0700

S3_auth:uri(En|De)code() pass by ref,not val(master)

Changed to pass the input const String by ref instead of value.

(cherry picked from commit 23a3f24b8567ad54968943ee4a258c865a866ff6)
---
 plugins/s3_auth/aws_auth_v4.cc| 2 +-
 plugins/s3_auth/unit-tests/test_aws_auth_v4.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index 1475111..58c0b8e 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -114,7 +114,7 @@ uriEncode(const String , bool isObjectName)
  * @return encoded string.
  */
 String
-uriDecode(const String in)
+uriDecode(const String )
 {
   std::string result;
   result.reserve(in.length());
diff --git a/plugins/s3_auth/unit-tests/test_aws_auth_v4.h 
b/plugins/s3_auth/unit-tests/test_aws_auth_v4.h
index 3306b8e..b46274d 100644
--- a/plugins/s3_auth/unit-tests/test_aws_auth_v4.h
+++ b/plugins/s3_auth/unit-tests/test_aws_auth_v4.h
@@ -119,8 +119,8 @@ public:
 
 /* Expose the following methods only to the unit tests */
 String base16Encode(const char *in, size_t inLen);
-String uriEncode(const String in, bool isObjectName = false);
-String uriDecode(const String in);
+String uriEncode(const String , bool isObjectName = false);
+String uriDecode(const String );
 String lowercase(const char *in, size_t inLen);
 const char *trimWhiteSpaces(const char *in, size_t inLen, size_t );
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated: S3_auth:uri(En|De)code() pass by ref, not val(master)

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 23a3f24  S3_auth:uri(En|De)code() pass by ref,not val(master)
23a3f24 is described below

commit 23a3f24b8567ad54968943ee4a258c865a866ff6
Author: Gancho Tenev 
AuthorDate: Wed Aug 30 15:43:49 2017 -0700

S3_auth:uri(En|De)code() pass by ref,not val(master)

Changed to pass the input const String by ref instead of value.
---
 plugins/s3_auth/aws_auth_v4.cc| 4 ++--
 plugins/s3_auth/unit-tests/test_aws_auth_v4.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index 8a624fa..f522118 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -78,7 +78,7 @@ base16Encode(const char *in, size_t inLen)
  * @return encoded string.
  */
 String
-uriEncode(const String in, bool isObjectName)
+uriEncode(const String , bool isObjectName)
 {
   std::stringstream result;
 
@@ -114,7 +114,7 @@ uriEncode(const String in, bool isObjectName)
  * @return encoded string.
  */
 String
-uriDecode(const String in)
+uriDecode(const String )
 {
   std::string result;
   result.reserve(in.length());
diff --git a/plugins/s3_auth/unit-tests/test_aws_auth_v4.h 
b/plugins/s3_auth/unit-tests/test_aws_auth_v4.h
index 3306b8e..b46274d 100644
--- a/plugins/s3_auth/unit-tests/test_aws_auth_v4.h
+++ b/plugins/s3_auth/unit-tests/test_aws_auth_v4.h
@@ -119,8 +119,8 @@ public:
 
 /* Expose the following methods only to the unit tests */
 String base16Encode(const char *in, size_t inLen);
-String uriEncode(const String in, bool isObjectName = false);
-String uriDecode(const String in);
+String uriEncode(const String , bool isObjectName = false);
+String uriDecode(const String );
 String lowercase(const char *in, size_t inLen);
 const char *trimWhiteSpaces(const char *in, size_t inLen, size_t );
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] 03/06: Add basic_string_view

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit d2b760c3c0918175dbf0b3511d35b9d92a95a5d9
Author: Jason Kenny 
AuthorDate: Wed Aug 30 13:38:21 2017 -0500

Add basic_string_view

add some unit testing based on Catch
---
 lib/ts/Makefile.am|   16 +-
 lib/ts/string_view.h  | 1216 +
 lib/ts/unit-tests/main.cpp|   25 +
 lib/ts/unit-tests/string_view.cpp |  523 
 tests/{ => include}/catch.hpp |0
 5 files changed, 1777 insertions(+), 3 deletions(-)

diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am
index 41ed45d..2e09e15 100644
--- a/lib/ts/Makefile.am
+++ b/lib/ts/Makefile.am
@@ -23,16 +23,16 @@ library_includedir=$(includedir)/ts
 library_include_HEADERS = apidefs.h
 
 noinst_PROGRAMS = mkdfa CompileParseRules
-check_PROGRAMS = test_tsutil test_arena test_atomic test_freelist 
test_geometry test_List test_Map test_Vec test_X509HostnameValidator 
test_MemView
+check_PROGRAMS = test_tsutil test_arena test_atomic test_freelist 
test_geometry test_List test_Map test_Vec test_X509HostnameValidator 
test_MemView test_tslib
 
 TESTS_ENVIRONMENT = LSAN_OPTIONS=suppressions=suppression.txt
 
 TESTS = $(check_PROGRAMS)
 
-AM_CPPFLAGS += -I$(abs_top_srcdir)/lib
-
 lib_LTLIBRARIES = libtsutil.la
 
+AM_CPPFLAGS += -I$(abs_top_srcdir)/lib 
+
 libtsutil_la_LDFLAGS = -no-undefined -version-info @TS_LIBTOOL_VERSION@
 libtsutil_la_LIBADD = \
   @HWLOC_LIBS@ \
@@ -190,6 +190,7 @@ libtsutil_la_SOURCES = \
   lockfile.cc \
   signals.cc \
   signals.h \
+  string_view.h \
   X509HostnameValidator.cc \
   X509HostnameValidator.h
 
@@ -239,6 +240,15 @@ test_tsutil_SOURCES = \
test_Regex.cc \
tests.cc
 
+test_tslib_CPPFLAGS = $(AM_CPPFLAGS)\
+   -I$(abs_top_srcdir)/tests/include
+
+# add you catch based test file here for tslib
+test_tslib_LDADD = libtsutil.la
+test_tslib_SOURCES = \
+   unit-tests/main.cpp \
+   unit-tests/string_view.cpp
+
 CompileParseRules_SOURCES = CompileParseRules.cc
 
 clean-local:
diff --git a/lib/ts/string_view.h b/lib/ts/string_view.h
new file mode 100644
index 000..ff902bf
--- /dev/null
+++ b/lib/ts/string_view.h
@@ -0,0 +1,1216 @@
+/** @file
+
+  This is an implemetation of the std::string_view class for us to use
+  with c++11 and 14 until we can use the c++ 17 standard. This has a few 
overloads
+  to deal with some ats objects to help with migration work
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if __cplusplus < 201402
+#define CONSTEXPR14 inline
+#else
+#define CONSTEXPR14 constexpr
+#endif
+
+namespace ts
+{
+// forward declare class for iterator friend relationship
+template > 
class basic_string_view;
+
+/
+// the iterator
+
+namespace _private_
+{
+  template  class string_view_iterator
+  { // iterator for character buffer wrapper
+  public:
+using iterator_category = std::random_access_iterator_tag;
+using value_type= typename _CharTraits::char_type;
+using difference_type   = std::ptrdiff_t;
+using pointer   = const value_type *;
+using reference = const value_type &;
+
+constexpr string_view_iterator() noexcept = default;
+
+  private:
+friend basic_string_view;
+
+constexpr explicit string_view_iterator(const pointer rhs) noexcept : 
m_ptr(rhs) {}
+
+  public:
+constexpr reference operator*() const noexcept
+{ // return designated object
+  return *m_ptr;
+}
+
+constexpr pointer operator->() const noexcept
+{ // return pointer to class object
+  return m_ptr;
+}
+
+CONSTEXPR14 string_view_iterator ++() noexcept
+{ // preincrement
+  ++m_ptr;
+  return *this;
+}
+
+CONSTEXPR14 string_view_iterator operator++(int)noexcept
+{ // postincrement
+  string_view_iterator tmp{*this};
+  ++*this;
+  return tmp;
+}
+
+CONSTEXPR14 

[trafficserver] 04/06: Added constructor for ats_scoped_str of std::string and string_view

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 5d9041b26dde963114cf0c57473bfc03f5c099b0
Author: Xavier Chi 
AuthorDate: Mon Jul 31 16:01:54 2017 -0500

Added constructor for ats_scoped_str of std::string and string_view
---
 lib/ts/ink_memory.h  | 38 ++
 lib/ts/string_view.h |  4 
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/lib/ts/ink_memory.h b/lib/ts/ink_memory.h
index 2eb08d8..4276b2f 100644
--- a/lib/ts/ink_memory.h
+++ b/lib/ts/ink_memory.h
@@ -27,7 +27,9 @@
 #include 
 #include 
 #include 
+#include 
 
+#include "ts/string_view.h"
 #include "ts/ink_config.h"
 
 #if HAVE_UNISTD_H
@@ -442,6 +444,22 @@ public:
   explicit ats_scoped_str(size_t n) : super(static_cast(ats_malloc(n))) {}
   /// Put string @a s in this container for cleanup.
   explicit ats_scoped_str(char *s) : super(s) {}
+  // constructor with std::string
+  explicit ats_scoped_str(const std::string )
+  {
+if (s.empty())
+  _r = nullptr;
+else
+  _r = strdup(s.c_str());
+  }
+  // constructor with string_view
+  explicit ats_scoped_str(const ts::string_view )
+  {
+if (s.empty())
+  _r = nullptr;
+else
+  _r = strdup(s.data());
+  }
   /// Assign a string @a s to this container.
   self &
   operator=(char *s)
@@ -449,6 +467,26 @@ public:
 super::operator=(s);
 return *this;
   }
+  // std::string case
+  self &
+  operator=(const std::string )
+  {
+if (s.empty())
+  _r = nullptr;
+else
+  _r = strdup(s.c_str());
+return *this;
+  }
+  // string_view case
+  self &
+  operator=(const ts::string_view )
+  {
+if (s.empty())
+  _r = nullptr;
+else
+  _r = strdup(s.data());
+return *this;
+  }
 };
 
 /** Specialization of @c ats_scoped_resource for pointers allocated with @c 
ats_malloc.
diff --git a/lib/ts/string_view.h b/lib/ts/string_view.h
index ff902bf..87b5ca4 100644
--- a/lib/ts/string_view.h
+++ b/lib/ts/string_view.h
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #if __cplusplus < 201402
 #define CONSTEXPR14 inline
@@ -241,9 +240,6 @@ public:
   // std::string constructor
   constexpr basic_string_view(std::string const ) noexcept : 
m_data(rhs.data()), m_size(rhs.size()) {}
 
-  // ats_scoped_str constructor
-  constexpr basic_string_view(ats_scoped_str const ) noexcept : 
m_data(rhs.get()), m_size(traits_type::length(rhs.get())) {}
-
   // For iterator on string_view we don't need to deal with const and 
non-const as different types
   // they are all const iterators as the string values are immutable
   // keep in mind that the string view is mutable in what it points to

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] 05/06: Clang-format

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 00c1c794d5bf9a871279cdad2f18d478d606dde5
Author: Jason Kenny 
AuthorDate: Wed Aug 30 15:48:39 2017 -0500

Clang-format
---
 lib/ts/string_view.h | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/ts/string_view.h b/lib/ts/string_view.h
index 87b5ca4..c059085 100644
--- a/lib/ts/string_view.h
+++ b/lib/ts/string_view.h
@@ -65,7 +65,6 @@ namespace _private_
 friend basic_string_view;
 
 constexpr explicit string_view_iterator(const pointer rhs) noexcept : 
m_ptr(rhs) {}
-
   public:
 constexpr reference operator*() const noexcept
 { // return designated object
@@ -220,7 +219,6 @@ public:
   static constexpr size_type npos{~0ULL};
 
   constexpr basic_string_view() noexcept {}
-
   constexpr basic_string_view(basic_string_view const &) noexcept = default;
   CONSTEXPR14 basic_string_view =(basic_string_view const &) noexcept 
= default;
 
@@ -231,15 +229,14 @@ public:
   // at compile time. With c++ 17 the constexpr guarrentee
   // that the literal length is optimized out
   constexpr basic_string_view(const_pointer rhs) noexcept : m_data(rhs), 
m_size(traits_type::length(rhs)) {}
-
   constexpr basic_string_view(const_pointer rhs, const size_type length) 
noexcept // strengthened
-: m_data(rhs), m_size(length)
+: m_data(rhs),
+  m_size(length)
   {
   }
 
   // std::string constructor
   constexpr basic_string_view(std::string const ) noexcept : 
m_data(rhs.data()), m_size(rhs.size()) {}
-
   // For iterator on string_view we don't need to deal with const and 
non-const as different types
   // they are all const iterators as the string values are immutable
   // keep in mind that the string view is mutable in what it points to

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] 06/06: Resign server.pem for autests to 10 years

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit ef919e5d57a122c61f352909b8f8cff2a5fcd89b
Author: Oknet Xu 
AuthorDate: Mon Aug 28 10:56:16 2017 +0800

Resign server.pem for autests to 10 years
---
 tests/gold_tests/h2/ssl/server.pem| 20 ++--
 tests/gold_tests/remap/ssl/server.pem | 20 ++--
 tests/gold_tests/tls/ssl/server.pem   | 20 ++--
 tests/gold_tests/tls_hooks/ssl/server.pem | 20 ++--
 tests/tools/microServer/ssl/server.pem| 20 ++--
 5 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/tests/gold_tests/h2/ssl/server.pem 
b/tests/gold_tests/h2/ssl/server.pem
index a1de94f..3584a2e 100644
--- a/tests/gold_tests/h2/ssl/server.pem
+++ b/tests/gold_tests/h2/ssl/server.pem
@@ -14,19 +14,19 @@ 
lORoveLvotl4HOruSsMCQQCAx9dV9JUSFoyc1CWILp/FgUH/se4cjQCThGO0DoQQ
 vGTYmntY7j9WRJ9esQrjdD6Clw8zM/45GIBNwnXzqo7Z
 -END RSA PRIVATE KEY-
 -BEGIN CERTIFICATE-
-MIICszCCAhwCCQCRJsJJ+mTsdDANBgkqhkiG9w0BAQsFADCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAklMMRIwEAYDVQQHDAlDaGFtcGFpZ24xDjAMBgNVBAoMBVlh
-aG9vMQ0wCwYDVQQLDARFZGdlMSgwJgYDVQQDDB9qdWljZXByb2R1Y2UuY29ycC5u
+MIICszCCAhwCCQCl0Y79KkYjpzANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgTAklMMRIwEAYDVQQHEwlDaGFtcGFpZ24xDjAMBgNVBAoTBVlh
+aG9vMQ0wCwYDVQQLEwRFZGdlMSgwJgYDVQQDEx9qdWljZXByb2R1Y2UuY29ycC5u
 ZTEueWFob28uY29tMSQwIgYJKoZIhvcNAQkBFhVwZXJzaWEuYXppekB5YWhvby5j
-b20wHhcNMTYwODI1MjI1NzIxWhcNMTcwODI1MjI1NzIxWjCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAklMMRIwEAYDVQQHDAlDaGFtcGFpZ24xDjAMBgNVBAoMBVlh
-aG9vMQ0wCwYDVQQLDARFZGdlMSgwJgYDVQQDDB9qdWljZXByb2R1Y2UuY29ycC5u
+b20wHhcNMTcwODI4MDI1MjI5WhcNMjcwODI2MDI1MjI5WjCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgTAklMMRIwEAYDVQQHEwlDaGFtcGFpZ24xDjAMBgNVBAoTBVlh
+aG9vMQ0wCwYDVQQLEwRFZGdlMSgwJgYDVQQDEx9qdWljZXByb2R1Y2UuY29ycC5u
 ZTEueWFob28uY29tMSQwIgYJKoZIhvcNAQkBFhVwZXJzaWEuYXppekB5YWhvby5j
 b20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYwc6JQX45GZmMDEjwxYT11
 uVvuBBInfpYJeU8WIXHrKcX5LUSRcBikiKnlfSnMNRohsu6TElQACc60wQ7Q8KDE
 lBSsS1FaHzCIl1t1AkXRmz/1H65JSBvrV/6Z1NC+Gp58EbH7Gul8ByC1xaJm5ID1
-Dd++kOPlY5ZI9ZcFS7HLAgMBAAEwDQYJKoZIhvcNAQELBQADgYEAXSVfZ5p1TkhW
-QiYq9nfQlBnX2NVaf8ymA8edQR0qH/QBv4/52bNNXC7V/V+ev9LCho2iRMeYYyXB
-yo1wBAGR83lS9cF/tOABcYrxjdP54Sfkyh5fomcg8SV7zap6C8mhbV8r3EujbKCx
-igH3fMX5F/eRwNCzaMMyQsXaxTJ3trk=
+Dd++kOPlY5ZI9ZcFS7HLAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAASZbz+d+DdI+
+ypesJrlBRosXh0w8sIjkUSSdT/OuKEVzfH/dRcb4VZDW/W2gmm0VEqSN2xYYVpW3
+hUsW2J+kByqFqX6selREwo8ui8kkyBJVo0y/MCrGM0C3qw1cSaiKoa5OqlOyO3hb
+ZC9IIyWmpBxRmJFfIwS6MoTpe0/ZTJQ=
 -END CERTIFICATE-
diff --git a/tests/gold_tests/remap/ssl/server.pem 
b/tests/gold_tests/remap/ssl/server.pem
index a1de94f..58b9b97 100644
--- a/tests/gold_tests/remap/ssl/server.pem
+++ b/tests/gold_tests/remap/ssl/server.pem
@@ -14,19 +14,19 @@ 
lORoveLvotl4HOruSsMCQQCAx9dV9JUSFoyc1CWILp/FgUH/se4cjQCThGO0DoQQ
 vGTYmntY7j9WRJ9esQrjdD6Clw8zM/45GIBNwnXzqo7Z
 -END RSA PRIVATE KEY-
 -BEGIN CERTIFICATE-
-MIICszCCAhwCCQCRJsJJ+mTsdDANBgkqhkiG9w0BAQsFADCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAklMMRIwEAYDVQQHDAlDaGFtcGFpZ24xDjAMBgNVBAoMBVlh
-aG9vMQ0wCwYDVQQLDARFZGdlMSgwJgYDVQQDDB9qdWljZXByb2R1Y2UuY29ycC5u
+MIICszCCAhwCCQD4jSkztmlO1TANBgkqhkiG9w0BAQsFADCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgTAklMMRIwEAYDVQQHEwlDaGFtcGFpZ24xDjAMBgNVBAoTBVlh
+aG9vMQ0wCwYDVQQLEwRFZGdlMSgwJgYDVQQDEx9qdWljZXByb2R1Y2UuY29ycC5u
 ZTEueWFob28uY29tMSQwIgYJKoZIhvcNAQkBFhVwZXJzaWEuYXppekB5YWhvby5j
-b20wHhcNMTYwODI1MjI1NzIxWhcNMTcwODI1MjI1NzIxWjCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAklMMRIwEAYDVQQHDAlDaGFtcGFpZ24xDjAMBgNVBAoMBVlh
-aG9vMQ0wCwYDVQQLDARFZGdlMSgwJgYDVQQDDB9qdWljZXByb2R1Y2UuY29ycC5u
+b20wHhcNMTcwODI4MDM0NDQ1WhcNMjcwODI2MDM0NDQ1WjCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgTAklMMRIwEAYDVQQHEwlDaGFtcGFpZ24xDjAMBgNVBAoTBVlh
+aG9vMQ0wCwYDVQQLEwRFZGdlMSgwJgYDVQQDEx9qdWljZXByb2R1Y2UuY29ycC5u
 ZTEueWFob28uY29tMSQwIgYJKoZIhvcNAQkBFhVwZXJzaWEuYXppekB5YWhvby5j
 b20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYwc6JQX45GZmMDEjwxYT11
 uVvuBBInfpYJeU8WIXHrKcX5LUSRcBikiKnlfSnMNRohsu6TElQACc60wQ7Q8KDE
 lBSsS1FaHzCIl1t1AkXRmz/1H65JSBvrV/6Z1NC+Gp58EbH7Gul8ByC1xaJm5ID1
-Dd++kOPlY5ZI9ZcFS7HLAgMBAAEwDQYJKoZIhvcNAQELBQADgYEAXSVfZ5p1TkhW
-QiYq9nfQlBnX2NVaf8ymA8edQR0qH/QBv4/52bNNXC7V/V+ev9LCho2iRMeYYyXB
-yo1wBAGR83lS9cF/tOABcYrxjdP54Sfkyh5fomcg8SV7zap6C8mhbV8r3EujbKCx
-igH3fMX5F/eRwNCzaMMyQsXaxTJ3trk=
+Dd++kOPlY5ZI9ZcFS7HLAgMBAAEwDQYJKoZIhvcNAQELBQADgYEATX7975NdhIbJ
+glda+sXI9a86GgOpiuKO+vKubRJQZA+UlPf2vHEONjC2+7Y1aZvZYaKYL74vxGky
+zkgp6ANSPl45lqD632x0e1Z7vzW5TkqK1JB2/xH2WgDcQZmP0FuQHzVNs4GjghDr
+HCp1+sQDhfPB4aLmLFeyN0TkhdH1N3M=
 -END CERTIFICATE-
diff --git a/tests/gold_tests/tls/ssl/server.pem 
b/tests/gold_tests/tls/ssl/server.pem
index a1de94f..58b9b97 100644
--- a/tests/gold_tests/tls/ssl/server.pem
+++ b/tests/gold_tests/tls/ssl/server.pem
@@ -14,19 +14,19 @@ 

[trafficserver] branch 7.1.x updated (9ef38ce -> ef919e5)

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 9ef38ce  Coverity: CID 1380042:Resource leaks  (RESOURCE_LEAK)
 new 6b60c65  Add basic files to use Catch for unit testing
 new 3a57712  Moved catch and got rid of centralizing unit tests
 new d2b760c  Add basic_string_view
 new 5d9041b  Added constructor for ats_scoped_str of std::string and 
string_view
 new 00c1c79  Clang-format
 new ef919e5  Resign server.pem for autests to 10 years

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ci/rat-regex.txt| 1 +
 lib/ts/Makefile.am  |16 +-
 lib/ts/ink_memory.h |38 +
 lib/ts/string_view.h|  1209 +++
 {plugins/s3_auth => lib/ts}/unit-tests/main.cpp | 4 +-
 lib/ts/unit-tests/string_view.cpp   |   523 +
 tests/gold_tests/h2/ssl/server.pem  |20 +-
 tests/gold_tests/remap/ssl/server.pem   |20 +-
 tests/gold_tests/tls/ssl/server.pem |20 +-
 tests/gold_tests/tls_hooks/ssl/server.pem   |20 +-
 tests/include/catch.hpp | 11545 ++
 tests/tools/microServer/ssl/server.pem  |20 +-
 12 files changed, 13381 insertions(+), 55 deletions(-)
 create mode 100644 lib/ts/string_view.h
 copy {plugins/s3_auth => lib/ts}/unit-tests/main.cpp (96%)
 create mode 100644 lib/ts/unit-tests/string_view.cpp
 create mode 100644 tests/include/catch.hpp

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] 02/06: Moved catch and got rid of centralizing unit tests

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 3a57712c56c25f35562f820dd0eed3da5cca4577
Author: Bryan Call 
AuthorDate: Thu Jul 20 10:05:36 2017 +0200

Moved catch and got rid of centralizing unit tests
---
 configure.ac |  1 -
 tests/{unit_tests => }/catch.hpp |  0
 tests/unit_tests/Makefile.am | 48 
 tests/unit_tests/main.cpp| 20 -
 4 files changed, 69 deletions(-)

diff --git a/configure.ac b/configure.ac
index d2f7c15..06b04a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1979,7 +1979,6 @@ AC_CONFIG_FILES([
   rc/trafficserver.conf
   rc/trafficserver.service
   rc/trafficserver.xml
-  tests/unit_tests/Makefile
   tools/Makefile
   tools/trafficserver.pc
   tools/tsxs
diff --git a/tests/unit_tests/catch.hpp b/tests/catch.hpp
similarity index 100%
rename from tests/unit_tests/catch.hpp
rename to tests/catch.hpp
diff --git a/tests/unit_tests/Makefile.am b/tests/unit_tests/Makefile.am
deleted file mode 100644
index 89ae25c..000
--- a/tests/unit_tests/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-AM_CPPFLAGS += \
-  $(iocore_include_dirs) \
-  -I$(abs_top_srcdir)/lib \
-  -I$(abs_top_srcdir)/lib/records \
-  -I$(abs_top_srcdir)/mgmt \
-  -I$(abs_top_srcdir)/mgmt/api/include \
-  @CURL_CFLAGS@ \
-  @CURSES_CFLAGS@
-
-AM_LDFLAGS += \
-  @OPENSSL_LDFLAGS@
-
-bin_PROGRAMS = unit_tests
-
-unit_tests_SOURCES = main.cpp
-
-unit_tests_LDADD = \
-  $(top_builddir)/lib/records/librecords_p.a \
-  $(top_builddir)/mgmt/libmgmt_p.la \
-  $(top_builddir)/iocore/eventsystem/libinkevent.a \
-  $(top_builddir)/proxy/shared/libUglyLogStubs.a \
-  $(top_builddir)/mgmt/api/libtsmgmt.la \
-  $(top_builddir)/lib/ts/libtsutil.la \
-  @CURL_LIBS@ \
-  @CURSES_LIBS@ \
-  @LIBTCL@ @HWLOC_LIBS@
-
-
-include $(top_srcdir)/build/tidy.mk
-tidy-local: $(DIST_SOURCES)
-   $(CXX_Clang_Tidy)
diff --git a/tests/unit_tests/main.cpp b/tests/unit_tests/main.cpp
deleted file mode 100644
index 9898b98..000
--- a/tests/unit_tests/main.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation(ASF) under one
-# or more contributor license agreements.See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-
-#define CATCH_CONFIG_MAIN 
-#include "catch.hpp"

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] branch 7.1.x updated: Coverity: CID 1380042:Resource leaks (RESOURCE_LEAK)

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
 new 9ef38ce  Coverity: CID 1380042:Resource leaks  (RESOURCE_LEAK)
9ef38ce is described below

commit 9ef38ce94d7945f7b54915898e5e13c192088829
Author: Vijay Mamidi 
AuthorDate: Wed Aug 30 14:11:14 2017 -0700

Coverity: CID 1380042:Resource leaks  (RESOURCE_LEAK)

(cherry picked from commit 7d893d577154ffd49e07009c2d8aa3c81ef84f60)
---
 iocore/net/SSLConfig.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 1ffc54d..e5d6b12 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -562,8 +562,10 @@ SSLTicketKeyConfig::reconfigure()
   SSLTicketParams *ticketKey = new SSLTicketParams();
 
   if (ticketKey) {
-if (!ticketKey->LoadTicket())
+if (!ticketKey->LoadTicket()) {
+  delete ticketKey;
   return false;
+}
   }
 
   configid = configProcessor.set(configid, ticketKey);

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated: Coverity: CID 1380042:Resource leaks (RESOURCE_LEAK)

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 7d893d5  Coverity: CID 1380042:Resource leaks  (RESOURCE_LEAK)
7d893d5 is described below

commit 7d893d577154ffd49e07009c2d8aa3c81ef84f60
Author: Vijay Mamidi 
AuthorDate: Wed Aug 30 14:11:14 2017 -0700

Coverity: CID 1380042:Resource leaks  (RESOURCE_LEAK)
---
 iocore/net/SSLConfig.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 0153ebf..3b15a8a 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -570,8 +570,10 @@ SSLTicketKeyConfig::reconfigure()
   SSLTicketParams *ticketKey = new SSLTicketParams();
 
   if (ticketKey) {
-if (!ticketKey->LoadTicket())
+if (!ticketKey->LoadTicket()) {
+  delete ticketKey;
   return false;
+}
   }
 
   configid = configProcessor.set(configid, ticketKey);

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch 7.1.x updated: AWS auth v4: fixed query param value URI-encoding

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
 new 6f91503  AWS auth v4: fixed query param value URI-encoding
6f91503 is described below

commit 6f91503febcc6e8b75decb7a9dc13e7f5a0cae14
Author: Gancho Tenev 
AuthorDate: Tue Aug 29 12:28:15 2017 -0700

AWS auth v4: fixed query param value URI-encoding

It seems AWS servers do not validate the signature according the spec they 
published here:
  
http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html 
("Task 1: Create a Canonical Request”)

When AWS servers validate the signature (CanonicalQueryString inside the 
CanonicalRequest)
they seem to check if the query parameter value is already encoded and 
don’t encode if it is,
which is nowhere mentioned neither in the spec nor in its examples.

Added a check to be consistent with AWS behavior while still waiting for 
response/confirmation from AWS.

(cherry picked from commit 3e20b077bb96ef7eead26e48ea9e255902453a6e)
---
 plugins/s3_auth/aws_auth_v4.cc | 46 -
 plugins/s3_auth/unit-tests/test_aws_auth_v4.cc | 91 ++
 plugins/s3_auth/unit-tests/test_aws_auth_v4.h  |  1 +
 3 files changed, 137 insertions(+), 1 deletion(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index 5b8708a..1475111 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -23,6 +23,7 @@
  */
 
 #include /* strlen() */
+#include  /* stoi() */
 #include   /* strftime(), time(), gmtime_r() */
 #include /* std::setw */
 #include /* std::stringstream */
@@ -69,6 +70,9 @@ base16Encode(const char *in, size_t inLen)
  *
  * @see AWS spec: 
http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
  *
+ * @todo Consider reusing / converting to TSStringPercentEncode() using a 
custom map to account for the AWS specific rules.
+ *   Currently we don't build a library/archive so we could link with the 
unit-test binary. Also using
+ *   different sets of encode/decode functions during runtime and 
unit-testing did not seem as a good idea.
  * @param in string to be URI encoded
  * @param isObjectName if true don't encode '/', keep it as it is.
  * @return encoded string.
@@ -99,6 +103,35 @@ uriEncode(const String , bool isObjectName)
 }
 
 /**
+ * @brief URI-decode a character string (AWS specific version, see spec)
+ *
+ * @see AWS spec: 
http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
+ *
+ * @todo Consider reusing / converting to TSStringPercentDecode()
+ *   Currently we don't build a library/archive so we could link with the 
unit-test binary. Also using
+ *   different sets of encode/decode functions during runtime and 
unit-testing did not seem as a good idea.
+ * @param in string to be URI decoded
+ * @return encoded string.
+ */
+String
+uriDecode(const String in)
+{
+  std::string result;
+  result.reserve(in.length());
+  size_t i = 0;
+  while (i < in.length()) {
+if (in[i] == '%') {
+  result += static_cast(std::stoi(in.substr(i + 1, 2), nullptr, 16));
+  i += 3;
+} else {
+  result += in[i];
+  i++;
+}
+  }
+  return result;
+}
+
+/**
  * @brief trim the white-space character from the beginning and the end of the 
string ("in-place", just moving pointers around)
  *
  * @param in ptr to an input string
@@ -256,7 +289,18 @@ getCanonicalRequestSha256Hash(TsInterface , bool 
signPayload, const StringSe
 String encodedParam = uriEncode(param, /* isObjectName */ false);
 
 paramNames.insert(encodedParam);
-paramsMap[encodedParam] = uriEncode(value, /* isObjectName */ false);
+
+/* Look for '%' first trying to avoid as many uri-decode calls as possible.
+ * it is hard to estimate which is more likely use-case - (1) URIs with 
uri-encoded query parameter
+ * values or (2) with unencoded which defines the success of this 
optimization */
+if (nullptr == memchr(value.c_str(), '%', value.length()) || 0 == 
uriDecode(value).compare(value)) {
+  /* Not URI-encoded */
+  paramsMap[encodedParam] = uriEncode(value, /* isObjectName */ false);
+} else {
+  /* URI-encoded, then don't encode since AWS does not encode which is not 
mentioned in the spec,
+   * asked AWS, still waiting for confirmation */
+  paramsMap[encodedParam] = value;
+}
   }
 
   String queryStr;
diff --git a/plugins/s3_auth/unit-tests/test_aws_auth_v4.cc 
b/plugins/s3_auth/unit-tests/test_aws_auth_v4.cc
index 4589aca..f325179 100644
--- a/plugins/s3_auth/unit-tests/test_aws_auth_v4.cc
+++ b/plugins/s3_auth/unit-tests/test_aws_auth_v4.cc
@@ -68,6 +68,39 @@ TEST_CASE("uriEncode(): encode reserved chars in 

[trafficserver] branch master updated: bug fix for event thread names

2017-08-30 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 46b6c73  bug fix for event thread names
46b6c73 is described below

commit 46b6c735c84926755362d4cf556a75c1c73d140d
Author: Fei Deng 
AuthorDate: Tue Aug 29 10:23:41 2017 -0500

bug fix for event thread names
---
 iocore/eventsystem/UnixEventProcessor.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iocore/eventsystem/UnixEventProcessor.cc 
b/iocore/eventsystem/UnixEventProcessor.cc
index b5001c0..7fc31e7 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -323,7 +323,6 @@ EventProcessor::spawn_event_threads(EventType ev_type, int 
n_threads, size_t sta
 t->id= i; // unfortunately needed to support 
affinity and NUMA logic.
 t->set_event_type(ev_type);
 t->schedule_spawn(_initializer);
-snprintf(thr_name, MAX_THREAD_NAME_LENGTH, "[%s %d]", tg->_name.get(), i);
   }
   tg->_count = n_threads;
   n_ethreads += n_threads;
@@ -332,6 +331,7 @@ EventProcessor::spawn_event_threads(EventType ev_type, int 
n_threads, size_t sta
   // the group. Some thread set up depends on knowing the total number of 
threads but that can't be
   // safely updated until all the EThread instances are created and stored in 
the table.
   for (i = 0; i < n_threads; ++i) {
+snprintf(thr_name, MAX_THREAD_NAME_LENGTH, "[%s %d]", tg->_name.get(), i);
 void *stack = Thread_Affinity_Initializer.alloc_stack(tg->_thread[i], 
stacksize);
 tg->_thread[i]->start(thr_name, stack, stacksize);
   }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch 7.1.x updated: Revert "FD leaks when ep.start() failed or cancelled in acceptEvent or con.connect() failed"

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
 new bf19960  Revert "FD leaks when ep.start() failed or cancelled in 
acceptEvent or con.connect() failed"
bf19960 is described below

commit bf1996041fbcb97d9a92aa6ddaf6573077df6e87
Author: Leif Hedstrom 
AuthorDate: Wed Aug 30 10:32:03 2017 -0600

Revert "FD leaks when ep.start() failed or cancelled in acceptEvent or 
con.connect() failed"

This reverts commit 319e219f6b98f331e6cd0e6ee302da770a150213.
---
 iocore/net/SSLNetVConnection.cc  | 1 +
 iocore/net/UnixNetVConnection.cc | 8 +++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 9b389a2..53d7012 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -892,6 +892,7 @@ SSLNetVConnection::free(EThread *t)
 
   closed = 0;
   options.reset();
+  con.close();
 
   ink_assert(con.fd == NO_FD);
 
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 122cd42..c914f6c 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -94,6 +94,7 @@ close_UnixNetVConnection(UnixNetVConnection *vc, EThread *t)
   NetHandler *nh = vc->nh;
   vc->cancel_OOB();
   vc->ep.stop();
+  vc->con.close();
 
   ink_release_assert(vc->thread == t);
 
@@ -1151,14 +1152,14 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
 
   SET_HANDLER((NetVConnHandler)::mainEvent);
 
+  nh = get_NetHandler(thread);
   PollDescriptor *pd = get_PollDescriptor(thread);
   if (ep.start(pd, this, EVENTIO_READ | EVENTIO_WRITE) < 0) {
 Debug("iocore_net", "acceptEvent : failed EventIO::start");
-free(t);
+close_UnixNetVConnection(this, e->ethread);
 return EVENT_DONE;
   }
 
-  nh = get_NetHandler(thread);
   set_inactivity_timeout(0);
   nh->open_list.enqueue(this);
 
@@ -1393,9 +1394,6 @@ void
 UnixNetVConnection::free(EThread *t)
 {
   ink_release_assert(t == this_ethread());
-
-  // close socket fd
-  con.close();
   // clear variables for reuse
   this->mutex.clear();
   action_.mutex.clear();

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated: TS-4976: Regularize plugins - ssl_sni

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 2ab5899  TS-4976: Regularize plugins - ssl_sni
2ab5899 is described below

commit 2ab58998f14337644c6bcf8cec54fec6af986604
Author: Alan M. Carroll 
AuthorDate: Fri Aug 25 07:14:22 2017 -0500

TS-4976: Regularize plugins - ssl_sni
---
 example/Makefile.am|  4 +--
 example/{ssl-sni/ssl-sni.cc => ssl_sni/ssl_sni.cc} | 42 --
 example/{ssl-sni => ssl_sni}/ssl_sni.config|  0
 3 files changed, 17 insertions(+), 29 deletions(-)

diff --git a/example/Makefile.am b/example/Makefile.am
index b17b33e..069c9ea 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -53,7 +53,7 @@ example_Plugins = \
session_hooks.la \
ssl_preaccept.la \
ssl-sni-whitelist.la \
-   ssl-sni.la \
+   ssl_sni.la \
statistic.la \
thread-1.la \
txn-data-sink.la \
@@ -118,7 +118,7 @@ secure_link_la_SOURCES = secure_link/secure_link.c
 server_push_la_SOURCES = server_push/server_push.c
 server_transform_la_SOURCES = server_transform/server_transform.c
 ssl_preaccept_la_SOURCES = ssl_preaccept/ssl_preaccept.cc
-ssl_sni_la_SOURCES = ssl-sni/ssl-sni.cc
+ssl_sni_la_SOURCES = ssl_sni/ssl_sni.cc
 ssl_sni_la_LIBADD = $(libtsconfig)
 ssl_sni_whitelist_la_SOURCES = ssl-sni-whitelist/ssl-sni-whitelist.cc
 ssl_sni_whitelist_la_LIBADD = $(libtsconfig)
diff --git a/example/ssl-sni/ssl-sni.cc b/example/ssl_sni/ssl_sni.cc
similarity index 84%
rename from example/ssl-sni/ssl-sni.cc
rename to example/ssl_sni/ssl_sni.cc
index 110f861..2d9e1aa 100644
--- a/example/ssl-sni/ssl-sni.cc
+++ b/example/ssl_sni/ssl_sni.cc
@@ -1,6 +1,7 @@
-/**
-  @file
-  SSL Preaccept test plugin
+/** @file
+
+  SSL Preaccept test plugin.
+
   Implements blind tunneling based on the client IP address
   The client ip addresses are specified in the plugin's
   config file as an array of IP addresses or IP address ranges under the
@@ -29,7 +30,6 @@
 #include 
 #include 
 #include 
-#include "ts/ink_config.h"
 #include 
 #include 
 #include 
@@ -37,10 +37,8 @@
 using ts::config::Configuration;
 using ts::config::Value;
 
-#define PN "ssl-sni-test"
-#define PCP "[" PN " Plugin] "
-
-#if TS_USE_TLS_SNI
+#define PLUGIN_NAME "ssl_sni"
+#define PCP "[" PLUGIN_NAME "] "
 
 namespace
 {
@@ -93,7 +91,7 @@ CB_servername(TSCont /* contp */, TSEvent /* event */, void 
*edata)
 if (servername_len >= facebook_name_len) {
   const char *server_ptr = servername + (servername_len - 
facebook_name_len);
   if (strcmp(server_ptr, "facebook.com") == 0) {
-TSDebug("skh", "Blind tunnel from SNI callback");
+TSDebug(PLUGIN_NAME, "Blind tunnel from SNI callback");
 TSVConnTunnel(ssl_vc);
 // Don't reenable to ensure that we break out of the
 // SSL handshake processing
@@ -102,14 +100,14 @@ CB_servername(TSCont /* contp */, TSEvent /* event */, 
void *edata)
 }
 // If the name is yahoo, look for a context for safelyfiled and use that 
here
 if (strcmp("www.yahoo.com", servername) == 0) {
-  TSDebug("skh", "SNI name is yahoo ssl obj is %p", sslobj);
+  TSDebug(PLUGIN_NAME, "SNI name is yahoo ssl obj is %p", sslobj);
   if (sslobj) {
 TSSslContext ctxobj = TSSslContextFindByName("safelyfiled.com");
 if (ctxobj != nullptr) {
-  TSDebug("skh", "Found cert for safelyfiled");
+  TSDebug(PLUGIN_NAME, "Found cert for safelyfiled");
   SSL_CTX *ctx = reinterpret_cast(ctxobj);
   SSL_set_SSL_CTX(ssl, ctx);
-  TSDebug("skh", "SNI plugin cb: replace SSL CTX");
+  TSDebug(PLUGIN_NAME, "SNI plugin cb: replace SSL CTX");
 }
   }
 }
@@ -133,9 +131,9 @@ TSPluginInit(int argc, const char *argv[])
 {const_cast("config"), required_argument, nullptr, 'c'}, {nullptr, 
no_argument, nullptr, '\0'},
   };
 
-  info.plugin_name   = const_cast("SSL SNI callback test");
-  info.vendor_name   = const_cast("Network Geographics");
-  info.support_email = const_cast("shinr...@network-geographics.com");
+  info.plugin_name   = PLUGIN_NAME;
+  info.vendor_name   = "Apache Software Foundation";
+  info.support_email = "d...@trafficserver.apache.org";
 
   int opt = 0;
   while (opt >= 0) {
@@ -150,7 +148,7 @@ TSPluginInit(int argc, const char *argv[])
   if (ConfigPath.length() == 0) {
 static const char *const DEFAULT_CONFIG_PATH = "ssl_sni.config";
 ConfigPath   = 
std::string(TSConfigDirGet()) + '/' + std::string(DEFAULT_CONFIG_PATH);
-TSDebug(PN, "No config path set in arguments, using default: %s", 
DEFAULT_CONFIG_PATH);
+TSDebug(PLUGIN_NAME, "No config path set in arguments, using default: %s", 
DEFAULT_CONFIG_PATH);
   }
 
   if (TS_SUCCESS 

[trafficserver] branch master updated: Updated version of the jenkins autest build script

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 7c5737b  Updated version of the jenkins autest build script
7c5737b is described below

commit 7c5737b2e241045bbf16c01ba65968cfe273714e
Author: Leif Hedstrom 
AuthorDate: Tue Aug 29 16:35:44 2017 -0600

Updated version of the jenkins autest build script
---
 ci/jenkins/bin/autest.sh | 34 +++---
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/ci/jenkins/bin/autest.sh b/ci/jenkins/bin/autest.sh
index d3cb205..279f0fe 100644
--- a/ci/jenkins/bin/autest.sh
+++ b/ci/jenkins/bin/autest.sh
@@ -16,31 +16,43 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-cd "${WORKSPACE}/src"
+# Setup autoconf
+cd src
 [ -d tests ] || exit 0
 
 autoreconf -if
 
 INSTALL="${WORKSPACE}/${BUILD_NUMBER}/install"
-SANDBOX="/var/tmp/ausb-${ghprbPullId}"
+
+URL="https://ci.trafficserver.apache.org/files/autest;
+AUSB="ausb-${ghprbPullId}.${BUILD_NUMBER}"
+SANDBOX="/var/tmp/${AUSB}"
 
 mkdir -p $INSTALL
 
 ./configure --prefix="$INSTALL" \
 --with-user=jenkins \
 --enable-experimental-plugins \
---enable-example-plugins \
 --enable-ccache \
 --enable-debug \
 --enable-werror
 
 # Build and run regressions
-${ATS_MAKE} ${ATS_MAKE_FLAGS} V=1 Q=
-${ATS_MAKE} check VERBOSE=Y && ${ATS_MAKE} install
-
+${ATS_MAKE} ${ATS_MAKE_FLAGS} V=1 Q= || exit -1
+${ATS_MAKE} install
 /usr/bin/autest -D ./tests/gold_tests --sandbox "$SANDBOX" --ats-bin 
"${INSTALL}/bin"
-status="$?"
-
-[ "0" != "$status" ] && exit -1
-exit 0
-
+status=$?
+
+# Cleanup
+cd /var/tmp # To be safer
+if [ "0" != "$status" ]; then
+if [ -d "$SANDBOX" ]; then
+find "$SANDBOX" -name \*.db  -exec rm {} \;
+mv "$SANDBOX" /CA/autest
+echo "Sandbox is available at ${URL}/${AUSB}/"
+fi
+exit -1
+else
+[ -d "$SANDBOX" ] && rmdir "$SANDBOX"
+exit 0
+fi

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch 7.1.x updated: Ticket file reload shouldn't kill traffic_server process

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
 new b650c85  Ticket file reload shouldn't kill traffic_server process
b650c85 is described below

commit b650c85f1539d534d129ca08bd2cfd6459a10628
Author: Vijay Mamidi 
AuthorDate: Tue Aug 29 17:13:17 2017 -0700

Ticket file reload shouldn't kill traffic_server process

(cherry picked from commit 3f48a263b88197fca556165e91834450b0df56b7)
---
 iocore/net/P_SSLConfig.h |  2 +-
 iocore/net/SSLConfig.cc  | 27 ++-
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/iocore/net/P_SSLConfig.h b/iocore/net/P_SSLConfig.h
index 7728a41..f15df36 100644
--- a/iocore/net/P_SSLConfig.h
+++ b/iocore/net/P_SSLConfig.h
@@ -162,7 +162,7 @@ private:
 struct SSLTicketParams : public ConfigInfo {
   ssl_ticket_key_block *default_global_keyblock;
   char *ticket_key_filename;
-  void LoadTicket();
+  bool LoadTicket();
   void cleanup();
 
   ~SSLTicketParams() { cleanup(); }
diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index a94100b..1ffc54d 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -515,27 +515,31 @@ SSLCertificateConfig::release(SSLCertLookup *lookup)
   configProcessor.release(configid, lookup);
 }
 
-void
+bool
 SSLTicketParams::LoadTicket()
 {
   cleanup();
 
 #if HAVE_OPENSSL_SESSION_TICKETS
+  ssl_ticket_key_block *keyblock = nullptr;
 
   SSLConfig::scoped_config params;
 
   if (REC_ReadConfigStringAlloc(ticket_key_filename, 
"proxy.config.ssl.server.ticket_key.filename") == REC_ERR_OKAY &&
   ticket_key_filename != nullptr) {
 ats_scoped_str 
ticket_key_path(Layout::relative_to(params->serverCertPathOnly, 
ticket_key_filename));
-default_global_keyblock = ssl_create_ticket_keyblock(ticket_key_path);
+keyblock = ssl_create_ticket_keyblock(ticket_key_path);
   } else {
-default_global_keyblock = ssl_create_ticket_keyblock(nullptr);
+keyblock = ssl_create_ticket_keyblock(nullptr);
   }
-  if (!default_global_keyblock) {
-Fatal("Could not load Ticket Key from %s", ticket_key_filename);
-return;
+  if (!keyblock) {
+Error("ticket key reloaded from %s", ticket_key_filename);
+return false;
   }
+  default_global_keyblock = keyblock;
+
   Debug("ssl", "ticket key reloaded from %s", ticket_key_filename);
+  return true;
 
 #endif
 }
@@ -546,7 +550,10 @@ SSLTicketKeyConfig::startup()
   auto sslTicketKey = new ConfigUpdateHandler();
 
   sslTicketKey->attach("proxy.config.ssl.server.ticket_key.filename");
-  reconfigure();
+  SSLConfig::scoped_config params;
+  if (!reconfigure() && params->configExitOnLoadError) {
+Fatal("Failed to load SSL ticket key file");
+  }
 }
 
 bool
@@ -554,8 +561,10 @@ SSLTicketKeyConfig::reconfigure()
 {
   SSLTicketParams *ticketKey = new SSLTicketParams();
 
-  if (ticketKey)
-ticketKey->LoadTicket();
+  if (ticketKey) {
+if (!ticketKey->LoadTicket())
+  return false;
+  }
 
   configid = configProcessor.set(configid, ticketKey);
   return true;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated: Ticket file reload shouldn't kill traffic_server process

2017-08-30 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 3f48a26  Ticket file reload shouldn't kill traffic_server process
3f48a26 is described below

commit 3f48a263b88197fca556165e91834450b0df56b7
Author: Vijay Mamidi 
AuthorDate: Tue Aug 29 17:13:17 2017 -0700

Ticket file reload shouldn't kill traffic_server process
---
 iocore/net/P_SSLConfig.h |  2 +-
 iocore/net/SSLConfig.cc  | 27 ++-
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/iocore/net/P_SSLConfig.h b/iocore/net/P_SSLConfig.h
index 7728a41..f15df36 100644
--- a/iocore/net/P_SSLConfig.h
+++ b/iocore/net/P_SSLConfig.h
@@ -162,7 +162,7 @@ private:
 struct SSLTicketParams : public ConfigInfo {
   ssl_ticket_key_block *default_global_keyblock;
   char *ticket_key_filename;
-  void LoadTicket();
+  bool LoadTicket();
   void cleanup();
 
   ~SSLTicketParams() { cleanup(); }
diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index f480708..0153ebf 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -523,27 +523,31 @@ SSLCertificateConfig::release(SSLCertLookup *lookup)
   configProcessor.release(configid, lookup);
 }
 
-void
+bool
 SSLTicketParams::LoadTicket()
 {
   cleanup();
 
 #if HAVE_OPENSSL_SESSION_TICKETS
+  ssl_ticket_key_block *keyblock = nullptr;
 
   SSLConfig::scoped_config params;
 
   if (REC_ReadConfigStringAlloc(ticket_key_filename, 
"proxy.config.ssl.server.ticket_key.filename") == REC_ERR_OKAY &&
   ticket_key_filename != nullptr) {
 ats_scoped_str 
ticket_key_path(Layout::relative_to(params->serverCertPathOnly, 
ticket_key_filename));
-default_global_keyblock = ssl_create_ticket_keyblock(ticket_key_path);
+keyblock = ssl_create_ticket_keyblock(ticket_key_path);
   } else {
-default_global_keyblock = ssl_create_ticket_keyblock(nullptr);
+keyblock = ssl_create_ticket_keyblock(nullptr);
   }
-  if (!default_global_keyblock) {
-Fatal("Could not load Ticket Key from %s", ticket_key_filename);
-return;
+  if (!keyblock) {
+Error("ticket key reloaded from %s", ticket_key_filename);
+return false;
   }
+  default_global_keyblock = keyblock;
+
   Debug("ssl", "ticket key reloaded from %s", ticket_key_filename);
+  return true;
 
 #endif
 }
@@ -554,7 +558,10 @@ SSLTicketKeyConfig::startup()
   auto sslTicketKey = new ConfigUpdateHandler();
 
   sslTicketKey->attach("proxy.config.ssl.server.ticket_key.filename");
-  reconfigure();
+  SSLConfig::scoped_config params;
+  if (!reconfigure() && params->configExitOnLoadError) {
+Fatal("Failed to load SSL ticket key file");
+  }
 }
 
 bool
@@ -562,8 +569,10 @@ SSLTicketKeyConfig::reconfigure()
 {
   SSLTicketParams *ticketKey = new SSLTicketParams();
 
-  if (ticketKey)
-ticketKey->LoadTicket();
+  if (ticketKey) {
+if (!ticketKey->LoadTicket())
+  return false;
+  }
 
   configid = configProcessor.set(configid, ticketKey);
   return true;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated: Modernize literal 0 to nullptr

2017-08-30 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 1c6c1ae  Modernize literal 0 to nullptr
1c6c1ae is described below

commit 1c6c1aea3330d451c3f35bb8cb28e972093a27f6
Author: Masaori Koshiba 
AuthorDate: Tue Aug 22 11:07:00 2017 +0900

Modernize literal 0 to nullptr

Replace literal 0, which is matched by "void \*\S* = 0", with nullptr.
---
 iocore/eventsystem/I_Continuation.h  |  2 +-
 iocore/eventsystem/I_SocketManager.h |  8 
 lib/ts/IpMap.h   | 38 ++--
 plugins/esi/lib/HandlerManager.h |  2 +-
 proxy/http/HttpTransact.h|  2 +-
 5 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/iocore/eventsystem/I_Continuation.h 
b/iocore/eventsystem/I_Continuation.h
index 9c1521d..1881c3a 100644
--- a/iocore/eventsystem/I_Continuation.h
+++ b/iocore/eventsystem/I_Continuation.h
@@ -148,7 +148,7 @@ public:
 
   */
   int
-  handleEvent(int event = CONTINUATION_EVENT_NONE, void *data = 0)
+  handleEvent(int event = CONTINUATION_EVENT_NONE, void *data = nullptr)
   {
 return (this->*handler)(event, data);
   }
diff --git a/iocore/eventsystem/I_SocketManager.h 
b/iocore/eventsystem/I_SocketManager.h
index c85aeec..b8ff1d0 100644
--- a/iocore/eventsystem/I_SocketManager.h
+++ b/iocore/eventsystem/I_SocketManager.h
@@ -77,9 +77,9 @@ struct SocketManager {
 
   // result is the number of bytes or -errno
   int64_t read(int fd, void *buf, int len, void *pOLP = nullptr);
-  int64_t vector_io(int fd, struct iovec *vector, size_t count, int 
read_request, void *pOLP = 0);
+  int64_t vector_io(int fd, struct iovec *vector, size_t count, int 
read_request, void *pOLP = nullptr);
   int64_t readv(int fd, struct iovec *vector, size_t count);
-  int64_t read_vector(int fd, struct iovec *vector, size_t count, void *pOLP = 
0);
+  int64_t read_vector(int fd, struct iovec *vector, size_t count, void *pOLP = 
nullptr);
   int64_t pread(int fd, void *buf, int len, off_t offset, char *tag = nullptr);
 
   int recv(int s, void *buf, int len, int flags);
@@ -87,12 +87,12 @@ struct SocketManager {
 
   int64_t write(int fd, void *buf, int len, void *pOLP = nullptr);
   int64_t writev(int fd, struct iovec *vector, size_t count);
-  int64_t write_vector(int fd, struct iovec *vector, size_t count, void *pOLP 
= 0);
+  int64_t write_vector(int fd, struct iovec *vector, size_t count, void *pOLP 
= nullptr);
   int64_t pwrite(int fd, void *buf, int len, off_t offset, char *tag = 
nullptr);
 
   int send(int fd, void *buf, int len, int flags);
   int sendto(int fd, void *buf, int len, int flags, struct sockaddr const *to, 
int tolen);
-  int sendmsg(int fd, struct msghdr *m, int flags, void *pOLP = 0);
+  int sendmsg(int fd, struct msghdr *m, int flags, void *pOLP = nullptr);
   int64_t lseek(int fd, off_t offset, int whence);
   int fstat(int fd, struct stat *);
   int unlink(char *buf);
diff --git a/lib/ts/IpMap.h b/lib/ts/IpMap.h
index d3500d6..95439ab 100644
--- a/lib/ts/IpMap.h
+++ b/lib/ts/IpMap.h
@@ -191,7 +191,7 @@ public:
   */
   self (sockaddr const *min, ///< Minimum value in range.
  sockaddr const *max, ///< Maximum value in range.
- void *data = 0   ///< Client data payload.
+ void *data = nullptr ///< Client data payload.
  );
 
   /** Mark a range.
@@ -199,9 +199,9 @@ public:
   @note Convenience overload for IPv4 addresses.
   @return This object.
   */
-  self (in_addr_t min, ///< Minimum address (network order).
- in_addr_t max, ///< Maximum address (network order).
- void *data = 0 ///< Client data.
+  self (in_addr_t min,   ///< Minimum address (network order).
+ in_addr_t max,   ///< Maximum address (network order).
+ void *data = nullptr ///< Client data.
  );
 
   /** Mark a range.
@@ -209,9 +209,9 @@ public:
   @note Convenience overload for IPv4 addresses.
   @return This object.
   */
-  self (IpAddr const , ///< Minimum address (network order).
- IpAddr const , ///< Maximum address (network order).
- void *data = 0 ///< Client data.
+  self (IpAddr const ,   ///< Minimum address (network order).
+ IpAddr const ,   ///< Maximum address (network order).
+ void *data = nullptr ///< Client data.
  );
 
   /** Mark an IPv4 address @a addr with @a data.
@@ -219,8 +219,8 @@ public:
   @note Convenience overload for IPv4 addresses.
   @return This object.
   */
-  self (in_addr_t addr, ///< Address (network order).
- void *data = 0  ///< Client data.
+  self (in_addr_t addr,  ///< Address (network order).
+ void *data = nullptr ///< Client data.
  );
 
   

[trafficserver] branch master updated (0d1ebfa -> 3e20b07)

2017-08-30 Thread gancho
This is an automated email from the ASF dual-hosted git repository.

gancho pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 0d1ebfa  Ran clan-tidy with modernize-use-nullptr
 add 3e20b07  AWS auth v4: fixed query param value URI-encoding

No new revisions were added by this update.

Summary of changes:
 plugins/s3_auth/aws_auth_v4.cc | 46 -
 plugins/s3_auth/unit-tests/test_aws_auth_v4.cc | 91 ++
 plugins/s3_auth/unit-tests/test_aws_auth_v4.h  |  1 +
 3 files changed, 137 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated (06229c0 -> 0d1ebfa)

2017-08-30 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 06229c0  Corrects validation regex pattern for a config
 add 0d1ebfa  Ran clan-tidy with modernize-use-nullptr

No new revisions were added by this update.

Summary of changes:
 iocore/eventsystem/UnixEventProcessor.cc | 2 +-
 iocore/net/SSLNetVConnection.cc  | 4 ++--
 iocore/net/SSLUtils.cc   | 2 +-
 mgmt/ProcessManager.cc   | 2 +-
 plugins/s3_auth/s3_auth.cc   | 2 +-
 plugins/tcpinfo/tcpinfo.cc   | 2 +-
 proxy/http2/test_Http2DependencyTree.cc  | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated: Corrects validation regex pattern for a config

2017-08-30 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 06229c0  Corrects validation regex pattern for a config
06229c0 is described below

commit 06229c002e1e670fe718b39fe03b2e40eebae1d2
Author: Derek Dagit 
AuthorDate: Wed Aug 30 13:52:32 2017 +

Corrects validation regex pattern for a config

proxy.config.http.origin_max_connections_queue
---
 mgmt/RecordsConfig.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index d7dad32..3f90ad5 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -429,7 +429,7 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.http.origin_max_connections", RECD_INT, "0", 
RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.http.origin_max_connections_queue", RECD_INT, 
"-1", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.http.origin_max_connections_queue", RECD_INT, 
"-1", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
 ,
   {RECT_CONFIG, "proxy.config.http.origin_min_keep_alive_connections", 
RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
   ,

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] 01/02: Unit tests for AWS Signature Version 4

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit e798dfea32938f8c2bee716b1a34890a85ad15e2
Author: Gancho Tenev 
AuthorDate: Tue Apr 25 13:02:44 2017 -0700

Unit tests for AWS Signature Version 4

(cherry picked from commit 3bcc7ce051c391b1833fbb4f9343b45a96ae19ff)
---
 plugins/s3_auth/Makefile.inc   |   9 +
 plugins/s3_auth/aws_auth_v4.h  | 105 +--
 .../s3_auth/{aws_auth_v4.h => aws_auth_v4_wrap.h}  |  90 +--
 plugins/s3_auth/unit-tests/main.cpp|  25 +
 plugins/s3_auth/unit-tests/test_aws_auth_v4.cc | 861 +
 plugins/s3_auth/unit-tests/test_aws_auth_v4.h  | 145 
 6 files changed, 1051 insertions(+), 184 deletions(-)

diff --git a/plugins/s3_auth/Makefile.inc b/plugins/s3_auth/Makefile.inc
index 7865d5e..83af007 100644
--- a/plugins/s3_auth/Makefile.inc
+++ b/plugins/s3_auth/Makefile.inc
@@ -16,3 +16,12 @@
 
 pkglib_LTLIBRARIES += s3_auth/s3_auth.la
 s3_auth_s3_auth_la_SOURCES = s3_auth/s3_auth.cc s3_auth/aws_auth_v4.cc
+
+check_PROGRAMS +=  test_s3auth
+
+test_s3auth_CPPFLAGS = $(AM_CPPFLAGS) -I$(abs_top_srcdir)/tests/include 
-DAWS_AUTH_V4_UNIT_TEST
+test_s3auth_LDADD = $(OPENSSL_LIBS)
+test_s3auth_SOURCES = \
+s3_auth/unit-tests/main.cpp \
+s3_auth/unit-tests/test_aws_auth_v4.cc \
+s3_auth/aws_auth_v4.cc
diff --git a/plugins/s3_auth/aws_auth_v4.h b/plugins/s3_auth/aws_auth_v4.h
index 1959ddf..94d2a52 100644
--- a/plugins/s3_auth/aws_auth_v4.h
+++ b/plugins/s3_auth/aws_auth_v4.h
@@ -52,106 +52,11 @@ public:
   virtual HeaderIterator headerEnd() = 0;
 };
 
-/* Define a header iterator to be used in the plugin using ATS API */
-class HeaderIterator
-{
-public:
-  HeaderIterator() : _bufp(nullptr), _hdrs(TS_NULL_MLOC), _field(TS_NULL_MLOC) 
{}
-  HeaderIterator(TSMBuffer bufp, TSMLoc hdrs, TSMLoc field) : _bufp(bufp), 
_hdrs(hdrs), _field(field) {}
-  HeaderIterator(const HeaderIterator )
-  {
-_bufp  = it._bufp;
-_hdrs  = it._hdrs;
-_field = it._field;
-  }
-  ~HeaderIterator() {}
-  HeaderIterator &
-  operator=(HeaderIterator )
-  {
-_bufp  = it._bufp;
-_hdrs  = it._hdrs;
-_field = it._field;
-return *this;
-  }
-  HeaderIterator ++()
-  {
-/* @todo this is said to be slow in the API call comments, do something 
better here */
-TSMLoc next = TSMimeHdrFieldNext(_bufp, _hdrs, _field);
-TSHandleMLocRelease(_bufp, _hdrs, _field);
-_field = next;
-return *this;
-  }
-  HeaderIterator operator++(int)
-  {
-HeaderIterator tmp(*this);
-operator++();
-return tmp;
-  }
-  bool
-  operator!=(const HeaderIterator )
-  {
-return _bufp != it._bufp || _hdrs != it._hdrs || _field != it._field;
-  }
-  bool
-  operator==(const HeaderIterator )
-  {
-return _bufp == it._bufp && _hdrs == it._hdrs && _field == it._field;
-  }
-  const char *
-  getName(int *len)
-  {
-return TSMimeHdrFieldNameGet(_bufp, _hdrs, _field, len);
-  }
-  const char *
-  getValue(int *len)
-  {
-return TSMimeHdrFieldValueStringGet(_bufp, _hdrs, _field, -1, len);
-  }
-  TSMBuffer _bufp;
-  TSMLoc _hdrs;
-  TSMLoc _field;
-};
-
-/* Define a API to be used in the plugin using ATS API */
-class TsApi : public TsInterface
-{
-public:
-  TsApi(TSMBuffer bufp, TSMLoc hdrs, TSMLoc url) : _bufp(bufp), _hdrs(hdrs), 
_url(url) {}
-  ~TsApi() {}
-  const char *
-  getMethod(int *len)
-  {
-return TSHttpHdrMethodGet(_bufp, _hdrs, len);
-  }
-  const char *
-  getHost(int *len)
-  {
-return TSHttpHdrHostGet(_bufp, _hdrs, len);
-  }
-  const char *
-  getPath(int *len)
-  {
-return TSUrlPathGet(_bufp, _url, len);
-  }
-  const char *
-  getQuery(int *len)
-  {
-return TSUrlHttpQueryGet(_bufp, _url, len);
-  }
-  HeaderIterator
-  headerBegin()
-  {
-return HeaderIterator(_bufp, _hdrs, TSMimeHdrFieldGet(_bufp, _hdrs, 0));
-  }
-  HeaderIterator
-  headerEnd()
-  {
-return HeaderIterator(_bufp, _hdrs, TS_NULL_MLOC);
-  }
-  TSMBuffer _bufp;
-  TSMLoc _hdrs;
-  TSMLoc _url;
-};
+#ifdef AWS_AUTH_V4_UNIT_TEST
+#include "unit-tests/test_aws_auth_v4.h"
+#else
+#include "aws_auth_v4_wrap.h"
+#endif
 
 /* S3 auth v4 utility API */
 
diff --git a/plugins/s3_auth/aws_auth_v4.h b/plugins/s3_auth/aws_auth_v4_wrap.h
similarity index 53%
copy from plugins/s3_auth/aws_auth_v4.h
copy to plugins/s3_auth/aws_auth_v4_wrap.h
index 1959ddf..b14f9c6 100644
--- a/plugins/s3_auth/aws_auth_v4.h
+++ b/plugins/s3_auth/aws_auth_v4_wrap.h
@@ -17,40 +17,13 @@
 */
 
 /**
- * @file aws_auth_v4.h
- * @brief AWS Auth v4 signing utility.
- * @see aws_auth_v4.cc
+ * @file aws_auth_v4_ts.h
+ * @brief TS API adaptor and header iterator using the TS API which are 
swapped with mocks during testing.
+ * @see aws_auth_v4.h
  */
 
-#ifndef PLUGINS_S3_AUTH_AWS_AUTH_V4_CC_
-#define PLUGINS_S3_AUTH_AWS_AUTH_V4_CC_
-
-#include  /* transform() 

[trafficserver] branch 7.1.x updated (71fdc75 -> 319e219)

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 71fdc75  Updated changelog
 new e798dfe  Unit tests for AWS Signature Version 4
 new 319e219  FD leaks when ep.start() failed or cancelled in acceptEvent 
or con.connect() failed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 iocore/net/SSLNetVConnection.cc|   1 -
 iocore/net/UnixNetVConnection.cc   |   8 +-
 plugins/s3_auth/Makefile.inc   |   9 +
 plugins/s3_auth/aws_auth_v4.h  | 105 +--
 .../s3_auth/{aws_auth_v4.h => aws_auth_v4_wrap.h}  |  90 +--
 .../s3_auth/unit-tests/main.cpp|   6 +-
 plugins/s3_auth/unit-tests/test_aws_auth_v4.cc | 861 +
 plugins/s3_auth/unit-tests/test_aws_auth_v4.h  | 145 
 8 files changed, 1034 insertions(+), 191 deletions(-)
 copy plugins/s3_auth/{aws_auth_v4.h => aws_auth_v4_wrap.h} (53%)
 copy iocore/eventsystem/test_P_Buffer.cc => 
plugins/s3_auth/unit-tests/main.cpp (88%)
 create mode 100644 plugins/s3_auth/unit-tests/test_aws_auth_v4.cc
 create mode 100644 plugins/s3_auth/unit-tests/test_aws_auth_v4.h

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] 02/02: FD leaks when ep.start() failed or cancelled in acceptEvent or con.connect() failed

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 319e219f6b98f331e6cd0e6ee302da770a150213
Author: Oknet Xu 
AuthorDate: Wed Aug 30 18:32:24 2017 +0800

FD leaks when ep.start() failed or cancelled in acceptEvent or 
con.connect() failed

(cherry picked from commit 9ded874c82de732d2c2d42c2b633d7e94adcb2e7)

 Conflicts:
iocore/net/UnixNetVConnection.cc
---
 iocore/net/SSLNetVConnection.cc  | 1 -
 iocore/net/UnixNetVConnection.cc | 8 +---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 53d7012..9b389a2 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -892,7 +892,6 @@ SSLNetVConnection::free(EThread *t)
 
   closed = 0;
   options.reset();
-  con.close();
 
   ink_assert(con.fd == NO_FD);
 
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index c914f6c..122cd42 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -94,7 +94,6 @@ close_UnixNetVConnection(UnixNetVConnection *vc, EThread *t)
   NetHandler *nh = vc->nh;
   vc->cancel_OOB();
   vc->ep.stop();
-  vc->con.close();
 
   ink_release_assert(vc->thread == t);
 
@@ -1152,14 +1151,14 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
 
   SET_HANDLER((NetVConnHandler)::mainEvent);
 
-  nh = get_NetHandler(thread);
   PollDescriptor *pd = get_PollDescriptor(thread);
   if (ep.start(pd, this, EVENTIO_READ | EVENTIO_WRITE) < 0) {
 Debug("iocore_net", "acceptEvent : failed EventIO::start");
-close_UnixNetVConnection(this, e->ethread);
+free(t);
 return EVENT_DONE;
   }
 
+  nh = get_NetHandler(thread);
   set_inactivity_timeout(0);
   nh->open_list.enqueue(this);
 
@@ -1394,6 +1393,9 @@ void
 UnixNetVConnection::free(EThread *t)
 {
   ink_release_assert(t == this_ethread());
+
+  // close socket fd
+  con.close();
   // clear variables for reuse
   this->mutex.clear();
   action_.mutex.clear();

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] branch master updated: FD leaks when ep.start() failed or cancelled in acceptEvent or con.connect() failed

2017-08-30 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 9ded874  FD leaks when ep.start() failed or cancelled in acceptEvent 
or con.connect() failed
9ded874 is described below

commit 9ded874c82de732d2c2d42c2b633d7e94adcb2e7
Author: Oknet Xu 
AuthorDate: Wed Aug 30 18:32:24 2017 +0800

FD leaks when ep.start() failed or cancelled in acceptEvent or 
con.connect() failed
---
 iocore/net/SSLNetVConnection.cc  | 1 -
 iocore/net/UnixNetVConnection.cc | 8 +---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 9d0ac5e..252b0c7 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -878,7 +878,6 @@ SSLNetVConnection::free(EThread *t)
 
   closed = 0;
   options.reset();
-  con.close();
 
   ink_assert(con.fd == NO_FD);
 
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 25e1582..8ed2eb0 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -84,7 +84,6 @@ close_UnixNetVConnection(UnixNetVConnection *vc, EThread *t)
   NetHandler *nh = vc->nh;
   vc->cancel_OOB();
   vc->ep.stop();
-  vc->con.close();
 
   ink_release_assert(vc->thread == t);
 
@@ -1141,14 +1140,14 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
 
   SET_HANDLER((NetVConnHandler)::mainEvent);
 
-  nh = get_NetHandler(thread);
   PollDescriptor *pd = get_PollDescriptor(thread);
   if (ep.start(pd, this, EVENTIO_READ | EVENTIO_WRITE) < 0) {
 Debug("iocore_net", "acceptEvent : failed EventIO::start");
-close_UnixNetVConnection(this, t);
+free(t);
 return EVENT_DONE;
   }
 
+  nh = get_NetHandler(thread);
   set_inactivity_timeout(0);
   nh->open_list.enqueue(this);
 
@@ -1372,6 +1371,9 @@ void
 UnixNetVConnection::free(EThread *t)
 {
   ink_release_assert(t == this_ethread());
+
+  // close socket fd
+  con.close();
   // clear variables for reuse
   this->mutex.clear();
   action_.mutex.clear();

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].


[trafficserver] branch master updated: Coverity: CID 1380037: Resource leaks (RESOURCE_LEAK)

2017-08-30 Thread oknet
This is an automated email from the ASF dual-hosted git repository.

oknet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new e3e3577  Coverity: CID 1380037:  Resource leaks  (RESOURCE_LEAK)
e3e3577 is described below

commit e3e3577a6024b9550acbb23e3e2b2ae20528bd3d
Author: Oknet Xu 
AuthorDate: Wed Aug 30 20:43:41 2017 +0800

Coverity: CID 1380037:  Resource leaks  (RESOURCE_LEAK)
---
 lib/ts/ink_sock.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ts/ink_sock.cc b/lib/ts/ink_sock.cc
index c8bb6d1..167e0ee 100644
--- a/lib/ts/ink_sock.cc
+++ b/lib/ts/ink_sock.cc
@@ -292,7 +292,7 @@ bind_unix_domain_socket(const char *path, mode_t mode)
 
   if (strlen(path) > sizeof(sockaddr.sun_path) - 1) {
 errno = ENAMETOOLONG;
-return -1;
+goto fail;
   }
 
   ink_zero(sockaddr);

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" '].