[trafficserver] branch master updated: Add ready checks for the microserver and ATS test instances. (#6625)

2020-04-07 Thread eze
This is an automated email from the ASF dual-hosted git repository.

eze 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 21f6a70  Add ready checks for the microserver and ATS test instances. 
(#6625)
21f6a70 is described below

commit 21f6a702f6874a49efa15336a740d1859f20bb15
Author: Evan Zelkowitz 
AuthorDate: Tue Apr 7 17:56:27 2020 -0700

Add ready checks for the microserver and ATS test instances. (#6625)

This fixed failing autest runs for nghttp on 8.1.x, adding to master first
---
 tests/gold_tests/h2/nghttp.test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/gold_tests/h2/nghttp.test.py 
b/tests/gold_tests/h2/nghttp.test.py
index 2e149a6..f0f6e18 100644
--- a/tests/gold_tests/h2/nghttp.test.py
+++ b/tests/gold_tests/h2/nghttp.test.py
@@ -78,7 +78,7 @@ tr = Test.AddTestRun()
 tr.Processes.Default.Command = "nghttp -v --no-dep 
'https://127.0.0.1:{0}/post' --trailer 'foo: bar' -d 'post_body'".format(
 ts.Variables.ssl_port)
 tr.Processes.Default.ReturnCode = 0
-tr.Processes.Default.StartBefore(microserver)
-tr.Processes.Default.StartBefore(Test.Processes.ts)
+tr.Processes.Default.StartBefore(microserver, 
ready=When.PortOpen(microserver.Variables.Port))
+tr.Processes.Default.StartBefore(Test.Processes.ts, 
ready=When.PortOpen(ts.Variables.ssl_port))
 tr.Processes.Default.Streams.stdout = "gold/nghttp_0_stdout.gold"
 tr.StillRunningAfter = microserver



[trafficserver] branch master updated (a885dc6 -> 3aeb0db)

2020-04-07 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 a885dc6  Patch to catch and invalidate an HTTP asset with negative 
bytes after cache_seek.
 add 3aeb0db  Updated ink_rwlock to be a real reader writer lock

No new revisions were added by this update.

Summary of changes:
 include/tscore/ink_rwlock.h |  54 ---
 src/tscore/ink_rwlock.cc| 123 
 2 files changed, 45 insertions(+), 132 deletions(-)



[trafficserver] branch master updated: Patch to catch and invalidate an HTTP asset with negative bytes after cache_seek.

2020-04-07 Thread jrushford
This is an automated email from the ASF dual-hosted git repository.

jrushford 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 a885dc6  Patch to catch and invalidate an HTTP asset with negative 
bytes after cache_seek.
a885dc6 is described below

commit a885dc63896e972bcde388c32019d258a6148398
Author: Brian Olsen 
AuthorDate: Wed Mar 11 17:31:42 2020 +

Patch to catch and invalidate an HTTP asset with negative bytes after 
cache_seek.
---
 iocore/cache/CacheRead.cc  | 57 --
 iocore/cache/P_CacheInternal.h |  1 +
 2 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/iocore/cache/CacheRead.cc b/iocore/cache/CacheRead.cc
index 5dc267b..6c89987 100644
--- a/iocore/cache/CacheRead.cc
+++ b/iocore/cache/CacheRead.cc
@@ -717,8 +717,46 @@ CacheVC::openReadMain(int /* event ATS_UNUSED */, Event * 
/* e ATS_UNUSED */)
 bytes = doc->len - doc_pos;
 if (is_debug_tag_set("cache_seek")) {
   char target_key_str[CRYPTO_HEX_SIZE];
-  key.toHexStr(target_key_str);
-  Debug("cache_seek", "Read # %d @ %" PRId64 "/%d for %" PRId64, fragment, 
doc_pos, doc->len, bytes);
+  Debug("cache_seek", "Read # %d @ %" PRId64 "/%d for %" PRId64 " %s", 
fragment, doc_pos, doc->len, bytes,
+key.toHexStr(target_key_str));
+}
+
+// This shouldn't happen for HTTP assets but it does
+// occasionally in production. This is a temporary fix
+// to clean up broken objects until the root cause can
+// be found. It must be the case that either the fragment
+// offsets are incorrect or a fragment table isn't being
+// created when it should be.
+if (frag_type == CACHE_FRAG_TYPE_HTTP && bytes < 0) {
+  char xt[CRYPTO_HEX_SIZE];
+  char yt[CRYPTO_HEX_SIZE];
+
+  int url_length   = 0;
+  char const *url_text = nullptr;
+  if (request.valid()) {
+url_text = request.url_get()->string_get_ref(_length);
+  }
+
+  int64_t prev_frag_size = 0;
+  if (fragment && frags) {
+prev_frag_size = static_cast(frags[fragment - 1]);
+  }
+
+  Warning("cache_seek range request bug: read %s targ %s - %s frag # %d 
(prev_frag %" PRId64 ") @ %" PRId64 "/%d for %" PRId64
+  " tot %" PRId64 " url '%.*s'",
+  doc->key.toHexStr(xt), key.toHexStr(yt), f.single_fragment ? 
"single" : "multi", fragment, prev_frag_size, doc_pos,
+  doc->len, bytes, doc->total_len, url_length, url_text);
+
+  doc->magic = DOC_CORRUPT;
+
+  CACHE_TRY_LOCK(lock, vol->mutex, mutex->thread_holding);
+  if (!lock.is_locked()) {
+SET_HANDLER(::openReadDirDelete);
+VC_SCHED_LOCK_RETRY();
+  }
+
+  dir_delete(_key, vol, _dir);
+  goto Lerror;
 }
   }
   if (ntodo <= 0) {
@@ -1218,3 +1256,18 @@ Learliest:
   SET_HANDLER(::openReadStartEarliest);
   return openReadStartEarliest(event, e);
 }
+
+/*
+   Handle a directory delete event in case of some detected corruption.
+*/
+int
+CacheVC::openReadDirDelete(int event, Event *e)
+{
+  MUTEX_TRY_LOCK(lock, vol->mutex, mutex->thread_holding);
+  if (!lock.is_locked()) {
+VC_SCHED_LOCK_RETRY();
+  }
+
+  dir_delete(_key, vol, _dir);
+  return calluser(VC_EVENT_ERROR);
+}
diff --git a/iocore/cache/P_CacheInternal.h b/iocore/cache/P_CacheInternal.h
index eb9a72c..3e05f2c 100644
--- a/iocore/cache/P_CacheInternal.h
+++ b/iocore/cache/P_CacheInternal.h
@@ -326,6 +326,7 @@ struct CacheVC : public CacheVConnection {
   int openReadFromWriterMain(int event, Event *e);
   int openReadFromWriterFailure(int event, Event *);
   int openReadChooseWriter(int event, Event *e);
+  int openReadDirDelete(int event, Event *e);
 
   int openWriteCloseDir(int event, Event *e);
   int openWriteCloseHeadDone(int event, Event *e);



[trafficserver] branch 8.1.x updated: Updated ChangeLog

2020-04-07 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 45a7db4  Updated ChangeLog
45a7db4 is described below

commit 45a7db497f1127aa9405dd9d19679bb6eadb0f7a
Author: Leif Hedstrom 
AuthorDate: Tue Apr 7 14:27:44 2020 -0600

Updated ChangeLog
---
 CHANGELOG-8.1.0 | 59 +
 1 file changed, 59 insertions(+)

diff --git a/CHANGELOG-8.1.0 b/CHANGELOG-8.1.0
index 4872548..cd8bd79 100644
--- a/CHANGELOG-8.1.0
+++ b/CHANGELOG-8.1.0
@@ -1,37 +1,59 @@
 Changes with Apache Traffic Server 8.1.0
   #3899 - Add a --reason tag option to the host subcommand
+  #4028 - proxy.config.http.connect_attempts_timeout tracks TTBF instead of 
connect
   #4203 - Allow enabling MPTCP on a listening socket through the records.config
   #4217 - Fix a regression in the traffic_ctl host status subcommand
   #4242 - header_rewrite: Adds basic string concatenation
   #4253 - Add the capability to mark origins down with traffic_ctl.
   #4300 - Expand the post chunked tests.
+  #4356 - slice plugin, intercept handler that uses cache_range_request
   #4422 - TCL: Rmove TCL dependency from HostStatus
   #4437 - Adds the log tag cqint for internal requests
   #4441 - Corrects the wording of the usage messages for traffic_ctl host 
subcommand
   #4461 - Fixes memory leaks in header_rewrite
+  #4513 - Adding cdnicrit claim support for uri signing service
+  #4540 - URI signing support for JWS to be passed as path parameter
   #4568 - Adjusts the format for header_rewrite string concatenation
   #4586 - Turn this Debug back into an Error
+  #4603 - Add cdniip and cdnistd claims to uri signing
+  #4604 - Repurpose sub claim and add cdniuc support for URI signing
   #4664 - Use hash string when it is provided for hashing
   #4762 - Fix OCSP stapling with dual cert
+  #4777 - Add unit tests for the URI signing plugin
+  #4802 - JWT validation uses a token-stripped URI
+  #4814 - Add normalization the URI before cdniuc validation in URI Signing
+  #4862 - Updates uri_signing docs to reflect new RFC changes
   #4869 - Cleanup: remove lib/cppapi from clang-format, it's been moved.
   #4874 - Avoid ats_malloc in unmarshal
+  #4897 - Uri signing regex as POSIX ERE
+  #4912 - Address performance issue by removing use of read_avail
   #4924 - lua plugin: add support for relative path scripts; moves inline 
script to switch
   #4944 - Add history to HTTP/2
+  #4988 - Implement nbf claim in Uri Signing Plugin
+  #5034 - Implement aud claim in Uri Signing Plugin
   #5058 - Fixed use after free when running regression under ASAN
+  #5075 - Fixed the compatibility with previous cache verison
+  #5112 - uri_signing build helpers
   #5122 - fix crash in CacheVC::openReadFromWriter
   #5131 - Do not run clang-format for @default_stack_size@
+  #5140 - cdniuc is not a manditory claim
   #5143 - Fix a self detection issue where parents are not marked down during 
ATS startup.
   #5149 - Add nullptr check on ConfigProcessor::release()
   #5163 - Fix memleak in ProcessManager::stop()
   #5176 - Adds a new log tag for the MPTCP state of a connection
+  #5199 - autest for slice plugin
   #5209 - Allows logging of negative values
   #5219 - url_sig debug fix for when url is missing the signature query string
   #5227 - Normalize on negative value for milestone metrics
   #5234 - Correct interpretation of proxy.config.ssl.client.verify.server
+  #5235 - Fix lost pending_actions causing actions on stale objects.
   #5236 - Update documentation for SSL VERIFY hooks.
   #5242 - Adds a missing header field for the tcpinfo log
   #5252 - Make host status persistent across restarts
+  #5267 - Slice errorlog
   #5268 - fix If-None-Match and If-Modified-Since priority problem
+  #5293 - Destroy MIMEFieldBlockImpl that doesn't have fields in use
+  #5301 - Slice Plugin: add options for disabling or pacing detailed block 
stitch error logging.
   #5329 - Fixes clang-analyzer error dereferencing nullptr in parent
   #5348 - Don't assign if this and other are the same object
   #5354 - Password can not be nullptr here, so don't check
@@ -40,6 +62,8 @@ Changes with Apache Traffic Server 8.1.0
   #5571 - Removes the abort() from header_rewrite, and try to deal with errors
   #5585 - Do not change stream state from HALF_CLOSED_REMOTE with CONTINUATION 
frame
   #5589 - Adds support for set-destination SCHEME/URL to take string expansions
+  #5605 - Fix crash in MIMEScanner::append with std::string.
+  #5607 - slice/HttpHeader memleak fix TSMLoc release call
   #5633 - HTTP/2: increment write_vio.ndone by consumed size
   #5634 - HTTP/2: cancel reading buffer when ATS received GOAWAY
   #5676 - Log H2 errors with the codes
@@ -47,10 +71,12 @@ Changes with Apache Traffic Server 8.1.0
   #5697 - Coalesce empty objects in HdrHeap
   

[trafficserver] branch master updated (a963331 -> 592518d)

2020-04-07 Thread amc
This is an automated email from the ASF dual-hosted git repository.

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


from a963331  Don't be overly aggressive on stream failures and closing
 add 592518d  Fix missing virtual destructor for PluginUserArgsMixin.

No new revisions were added by this update.

Summary of changes:
 include/tscore/PluginUserArgs.h | 1 +
 1 file changed, 1 insertion(+)



[trafficserver] branch 8.1.x updated: Reactivate active timeout enforcement

2020-04-07 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 8b9d827  Reactivate active timeout enforcement
8b9d827 is described below

commit 8b9d827f6a0bd95abe669fad94461f03671ad4ae
Author: Susan Hinrichs 
AuthorDate: Tue Aug 13 19:30:14 2019 +

Reactivate active timeout enforcement

(cherry picked from commit 3e039a28c9b68517c303a142c42fad6ff5f2b217)
---
 iocore/net/P_UnixNetVConnection.h |  2 +-
 iocore/net/UnixNet.cc | 16 --
 iocore/net/UnixNetVConnection.cc  | 18 +++
 tests/gold_tests/timeout/active_timeout.test.py   | 63 +++
 tests/gold_tests/timeout/inactive_timeout.test.py | 63 +++
 5 files changed, 149 insertions(+), 13 deletions(-)

diff --git a/iocore/net/P_UnixNetVConnection.h 
b/iocore/net/P_UnixNetVConnection.h
index 454e38d..c6ea08d 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -377,7 +377,7 @@ UnixNetVConnection::set_active_timeout(ink_hrtime 
timeout_in)
 {
   Debug("socket", "Set active timeout=%" PRId64 ", NetVC=%p", timeout_in, 
this);
   active_timeout_in= timeout_in;
-  next_activity_timeout_at = Thread::get_hrtime() + timeout_in;
+  next_activity_timeout_at = (active_timeout_in > 0) ? Thread::get_hrtime() + 
timeout_in : 0;
 }
 
 TS_INLINE void
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index eb95841..f6ba8f9 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -78,7 +78,11 @@ public:
 }
 Debug("inactivity_cop_verbose", "vc: %p now: %" PRId64 " timeout at: 
%" PRId64 " timeout in: %" PRId64, vc,
   ink_hrtime_to_sec(now), vc->next_inactivity_timeout_at, 
vc->inactivity_timeout_in);
-vc->handleEvent(EVENT_IMMEDIATE, e);
+vc->handleEvent(VC_EVENT_INACTIVITY_TIMEOUT, e);
+  } else if (vc->next_activity_timeout_at && vc->next_activity_timeout_at 
< now) {
+Debug("inactivity_cop_verbose", "active vc: %p now: %" PRId64 " 
timeout at: %" PRId64 " timeout in: %" PRId64, vc,
+  ink_hrtime_to_sec(now), vc->next_activity_timeout_at, 
vc->active_timeout_in);
+vc->handleEvent(VC_EVENT_ACTIVE_TIMEOUT, e);
   }
 }
 // The cop_list is empty now.
@@ -663,8 +667,14 @@ NetHandler::_close_vc(UnixNetVConnection *vc, ink_hrtime 
now, int _event,
 // create a dummy event
 Event event;
 event.ethread = this_ethread();
-if (vc->handleEvent(EVENT_IMMEDIATE, ) == EVENT_DONE) {
-  ++handle_event;
+if (vc->inactivity_timeout_in && vc->next_inactivity_timeout_at <= now) {
+  if (vc->handleEvent(VC_EVENT_INACTIVITY_TIMEOUT, ) == EVENT_DONE) {
+++handle_event;
+  }
+} else if (vc->active_timeout_in && vc->next_activity_timeout_at <= now) {
+  if (vc->handleEvent(VC_EVENT_ACTIVE_TIMEOUT, ) == EVENT_DONE) {
+++handle_event;
+  }
 }
   }
 }
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 80128f4..1ba92e4 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -1144,7 +1144,7 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
 int
 UnixNetVConnection::mainEvent(int event, Event *e)
 {
-  ink_assert(event == EVENT_IMMEDIATE || event == EVENT_INTERVAL);
+  ink_assert(event == VC_EVENT_ACTIVE_TIMEOUT || event == 
VC_EVENT_INACTIVITY_TIMEOUT);
   ink_assert(thread == this_ethread());
 
   MUTEX_TRY_LOCK(hlock, get_NetHandler(thread)->mutex, e->ethread);
@@ -1168,18 +1168,18 @@ UnixNetVConnection::mainEvent(int event, Event *e)
   Event *t  = nullptr;
   Event **signal_timeout= 
 
-  if (event == EVENT_IMMEDIATE) {
-/* BZ 49408 */
-// ink_assert(inactivity_timeout_in);
-// ink_assert(next_inactivity_timeout_at < Thread::get_hrtime());
-if (!inactivity_timeout_in || next_inactivity_timeout_at > 
Thread::get_hrtime()) {
-  return EVENT_CONT;
-}
+  switch (event) {
+  case VC_EVENT_INACTIVITY_TIMEOUT:
 signal_event  = VC_EVENT_INACTIVITY_TIMEOUT;
 signal_timeout_at = _inactivity_timeout_at;
-  } else {
+break;
+  case VC_EVENT_ACTIVE_TIMEOUT:
 signal_event  = VC_EVENT_ACTIVE_TIMEOUT;
 signal_timeout_at = _activity_timeout_at;
+break;
+  default:
+ink_release_assert(!"BUG: unexpected event in 
UnixNetVConnection::mainEvent");
+break;
   }
 
   *signal_timeout= nullptr;
diff --git a/tests/gold_tests/timeout/active_timeout.test.py 
b/tests/gold_tests/timeout/active_timeout.test.py
new file mode 100644
index 000..ef2c25f
--- /dev/null
+++ b/tests/gold_tests/timeout/active_timeout.test.py
@@ -0,0 +1,63 @@
+'''
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license 

[trafficserver] branch 8.1.x updated: proxy.config.http.connect_attempts_timeout tracks TTBF instead of connect

2020-04-07 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 3b5d77a  proxy.config.http.connect_attempts_timeout tracks TTBF 
instead of connect
3b5d77a is described below

commit 3b5d77ac9a68edae297d6e5177de1f3b002a469e
Author: Susan Hinrichs 
AuthorDate: Fri Jul 27 22:01:23 2018 +

proxy.config.http.connect_attempts_timeout tracks TTBF instead of connect

(cherry picked from commit 9b47aa6799db12fd302ea58e3ae0ba8485fd0bbe)
---
 iocore/net/I_NetProcessor.h   |  23 
 iocore/net/P_SSLNetVConnection.h  |  10 
 iocore/net/P_UnixNetVConnection.h |   6 ++
 iocore/net/UnixNetProcessor.cc| 116 --
 iocore/net/UnixNetVConnection.cc  |   7 +++
 proxy/http/HttpSM.cc  |  52 -
 6 files changed, 48 insertions(+), 166 deletions(-)

diff --git a/iocore/net/I_NetProcessor.h b/iocore/net/I_NetProcessor.h
index 142244b..570e7f3 100644
--- a/iocore/net/I_NetProcessor.h
+++ b/iocore/net/I_NetProcessor.h
@@ -176,8 +176,6 @@ public:
   call back with success. If this behaviour is desired use
   synchronous connect connet_s method.
 
-@see connect_s()
-
 @param cont Continuation to be called back with events.
 @param addr target address and port to connect to.
 @param options @see NetVCOptions.
@@ -187,27 +185,6 @@ public:
   inkcoreapi Action *connect_re(Continuation *cont, sockaddr const *addr, 
NetVCOptions *options = nullptr);
 
   /**
-Open a NetVConnection for connection oriented I/O. This call
-is simliar to connect method except that the cont is called
-back only after the connections has been established. In the
-case of connect the cont could be called back with NET_EVENT_OPEN
-event and OS could still be in the process of establishing the
-connection. Re-entrant Callbacks: same as connect. If unix
-asynchronous type connect is desired use connect_re().
-
-@param cont Continuation to be called back with events.
-@param addr Address to which to connect (includes port).
-@param timeout for connect, the cont will get NET_EVENT_OPEN_FAILED
-  if connection could not be established for timeout msecs. The
-  default is 30 secs.
-@param options @see NetVCOptions.
-
-@see connect_re()
-
-  */
-  Action *connect_s(Continuation *cont, sockaddr const *addr, int timeout = 
NET_CONNECT_TIMEOUT, NetVCOptions *opts = nullptr);
-
-  /**
 Initializes the net processor. This must be called before the event 
threads are started.
 
   */
diff --git a/iocore/net/P_SSLNetVConnection.h b/iocore/net/P_SSLNetVConnection.h
index 66505fd..ff7a801 100644
--- a/iocore/net/P_SSLNetVConnection.h
+++ b/iocore/net/P_SSLNetVConnection.h
@@ -101,6 +101,16 @@ public:
   }
 
   bool
+  trackFirstHandshake() override
+  {
+bool retval = sslHandshakeBeginTime == 0;
+if (retval) {
+  sslHandshakeBeginTime = Thread::get_hrtime();
+}
+return retval;
+  }
+
+  bool
   getSSLHandShakeComplete() const override
   {
 return sslHandShakeComplete;
diff --git a/iocore/net/P_UnixNetVConnection.h 
b/iocore/net/P_UnixNetVConnection.h
index 828b38c..454e38d 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -206,6 +206,12 @@ public:
 return (true);
   }
 
+  virtual bool
+  trackFirstHandshake()
+  {
+return false;
+  }
+
   virtual void net_read_io(NetHandler *nh, EThread *lthread);
   virtual int64_t load_buffer_and_write(int64_t towrite, MIOBufferAccessor 
, int64_t _written, int );
   void readDisable(NetHandler *nh);
diff --git a/iocore/net/UnixNetProcessor.cc b/iocore/net/UnixNetProcessor.cc
index 3aac473..d1ec316 100644
--- a/iocore/net/UnixNetProcessor.cc
+++ b/iocore/net/UnixNetProcessor.cc
@@ -306,122 +306,6 @@ UnixNetProcessor::connect(Continuation *cont, 
UnixNetVConnection ** /* avc */, s
   return connect_re(cont, target, opt);
 }
 
-struct CheckConnect : public Continuation {
-  UnixNetVConnection *vc;
-  Action action_;
-  MIOBuffer *buf;
-  IOBufferReader *reader;
-  int connect_status;
-  int recursion;
-  ink_hrtime timeout;
-
-  int
-  handle_connect(int event, Event *e)
-  {
-connect_status = event;
-switch (event) {
-case NET_EVENT_OPEN:
-  vc = (UnixNetVConnection *)e;
-  Debug("iocore_net_connect", "connect Net open");
-  vc->do_io_write(this, 10, /* some non-zero number just to get the poll 
going */
-  reader);
-  /* dont wait for more than timeout secs */
-  vc->set_inactivity_timeout(timeout);
-  return EVENT_CONT;
-  break;
-
-case NET_EVENT_OPEN_FAILED:
-  Debug("iocore_net_connect", "connect Net open failed");
-  if (!action_.cancelled) {
-action_.continuation->handleEvent(NET_EVENT_OPEN_FAILED, (void *)e);
-  }
- 

[trafficserver] branch 8.1.x updated: Adds a new log tag for the MPTCP state of a connection

2020-04-07 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 402c574  Adds a new log tag for the MPTCP state of a connection
402c574 is described below

commit 402c57484cf852bad5ce50e0f4a5064f13b1e639
Author: Leif Hedstrom 
AuthorDate: Fri Mar 15 09:08:42 2019 -0600

Adds a new log tag for the MPTCP state of a connection

Possible values are:

-1 == MPTCP was not enabled on the listening port
 0 == MPTCP was enabled, but not negotiated
 1 == MPTCP was enabled, and succesfully negotiated

(cherry picked from commit cdcd881e48bc25745d45f1c33a5f3ffc5d906d74)

 Conflicts:
iocore/net/I_NetVConnection.h
iocore/net/P_UnixNetVConnection.h
iocore/net/UnixNetAccept.cc
---
 doc/admin-guide/logging/formatting.en.rst | 13 +
 include/tscore/ink_platform.h |  9 +
 iocore/net/I_NetProcessor.h   |  6 ++
 iocore/net/I_NetVConnection.h | 19 +--
 iocore/net/P_UnixNetVConnection.h | 16 
 iocore/net/UnixNetAccept.cc   | 10 ++
 iocore/net/UnixNetProcessor.cc|  1 +
 mgmt/LocalManager.cc  | 12 +++-
 proxy/PluginVC.cc |  6 ++
 proxy/PluginVC.h  |  1 +
 proxy/http/HttpProxyServerMain.cc |  1 +
 proxy/http/HttpSM.cc  | 11 +++
 proxy/http/HttpSM.h   | 30 +++---
 proxy/logging/Log.cc  |  5 +
 proxy/logging/LogAccess.cc| 15 +++
 proxy/logging/LogAccess.h |  1 +
 16 files changed, 122 insertions(+), 34 deletions(-)

diff --git a/doc/admin-guide/logging/formatting.en.rst 
b/doc/admin-guide/logging/formatting.en.rst
index 2c512cc..7bed26f 100644
--- a/doc/admin-guide/logging/formatting.en.rst
+++ b/doc/admin-guide/logging/formatting.en.rst
@@ -45,7 +45,7 @@ The return value from the ``format`` function is the log 
format object which
 may then be supplied to the appropriate ``log.*`` functions that define your
 logging destinations.
 
-A very simple exampe, which contains only the timestamp of when the event began
+A very simple example, which contains only the timestamp of when the event 
began
 and the canonical URL of the request, would look like:
 
 .. code:: yaml
@@ -239,7 +239,7 @@ Error Code
 The log fields of error code which is triggered session close or
 transaction close. The first byte of this field indicates that the error
 code is session level (``S``) or transaction level (``T``).
-When no error code is received or transmitted, these fileds are ``-``.
+When no error code is received or transmitted, these fields are ``-``.
 For HTTP/2, error code are described in RFC 7540 section 7.
 
 = === =
@@ -634,6 +634,7 @@ TCP Details
 ~~~
 
 .. _cqtr:
+.. _cqmpt:
 
 The following logging fields reveal information about the TCP layer of client,
 proxy, and origin server connections.
@@ -644,6 +645,10 @@ Field Source Description
 cqtr  Client Request TCP reused status of the connection between the client and
  |TS| proxy, indicating whether the request was delivered
  through an already established connection.
+cqmpt Client Request Indicates the MPTCP state of the connection. ``-1`` means
+ MPTCP was not enabled on the listening port, whereas ``0``
+ and ``1`` indicates whether MPTCP was successfully
+ negotiated or not.
 = == ==
 
 .. _admin-logging-fields-time:
@@ -672,7 +677,7 @@ The logging fields expose a variety of timing related 
information about client,
 proxy, and origin transactions. Variants of some of the fields provide timing
 resolution of the same underlying detail in milliseconds and seconds (both
 fractional and rounded-down integers). These variants are particularly useful
-in accomodating the emulation of other HTTP proxy softwares' logging formats.
+in accommodating the emulation of other HTTP proxy softwares' logging formats.
 
 Other fields in this category provide variously formatted timestamps of
 particular events within the current transaction (e.g. the time at which a
@@ -705,7 +710,7 @@ msProxy   Timestamp in milliseconds of 
a specific milestone
   which milestone to use.
 msdms Proxy   Difference in milliseconds between the timestamps
   of two milestones. See note below about
-  specifying which miletones to 

[trafficserver] branch 8.1.x updated: Backport of all uri-signing changes in to 8.1.x

2020-04-07 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 4e55f19  Backport of all uri-signing changes in to 8.1.x
4e55f19 is described below

commit 4e55f19f37f3e6a9d2f8b266c54eb815b293aa20
Author: Dylan Souza 
AuthorDate: Mon Oct 29 21:40:04 2018 +

Backport of all uri-signing changes in to 8.1.x

List of included PRs:

- #6363 (partial pick)
- #6420
- #6419
- #6354
- #6252
- #4513
- #4603
- #4750 (partial pick)
- #4604
- #4540
- #4777
- #4862
- #4814
- #4802
- #4897
- #4988
- #5034
- #5140
- #5112
- #4895
- #5834 (partial pick)
- #6061
- #6210 (partial pick)
- #6265 (partial pick)
- #6282 (partial pick)

Updating uri_signing docs to reflect new RFC changes

(cherry picked from commit 90e51a2c47209a5342fbefb63128e9d6d9cfbc05)

Add normalization the URI before cdniuc validation

(cherry picked from commit b39b0f7dd74b66dd11b7d62f49f3432a10dc7fbd)

JWT Parser strips token from URI and places in buffer

(cherry picked from commit 5f9d358b721fbe9b7660e23610d19632f7655503)

Use POSIX ERE for uri signing regex evaluation

(cherry picked from commit be56b3aa010723d15fdcc77ff2cb85fbaceb8fc5)

Implement nbf claim in Uri Signing Plugin

(cherry picked from commit d9dc0f42e9f161f8a943483ab8dc38d178b18e16)

Implement aud claim in Uri Signing Plugin

The Aud claim is implemented as per the RFC version 16 that
can be found here:https://tools.ietf.org/html/draft-ietf-cdni-uri-signing-16

As per the specification, the aud claim can be either a JSON array or
a string. The aud claim is stored as raw json in the jwt class
in this implementation. It is converted either to an array or a
string at validation time.

This commit also expands the unit tests quite a bit. Test configs
can be provided in the unit_tests directory and parsed in the test 
framework.
JWS validation is also testable now.

This commit also fixes two memory leaks
1. Issuers were never being freed on configuration cleanup.
2. Token renewal allocates a tmp json_object without freeing.

(cherry picked from commit 012d437f54daedaf0cc6d67d2d15f836c38d0bf6)

cdniuc is not a manditory claim

With Internet Draft 16 for uri signing, the cdniuc claim is not manditory. 
It
took the place of the manditory sub claim in draft 12, and the manditory 
nature
of the sub claim was still in effect. This change allows for tokens to not 
contain
the cdniuc claim and also renews the cdniuc and cdnistd claim on token 
renewal.

(cherry picked from commit fa537711fec0f70916cb5fc2d6aa72590ed4708c)

add --with-jansson and --with-cjose options, document sample commands for 
building and configuring both locally

(cherry picked from commit 0cce83ca4aff2dccad595bc5a4d45b351e5e24dc)

Strip token from upstream if conifigured and dynamically allocate string 
buffers

Adds a configuration option to strip uri signing tokens from both the cache 
key
URL and the upstream URL.

Additionally it was pointed out that some statically allocated buffers were 
too small in
some of the string manipulating functions (normalize and strip token). 
These buffers are
now dynamically allocated since the maximum buffer size is known for these.

(cherry picked from commit 192dc8300209ed17b0ff1c96aafba0f4096b27b2)

Cherry-pick from commit 4cfd5a73824843836c22481416503d3d4c35dc19

Add Example URI Signer Python Script

Provide an example script to be used in conjunction with the uri signing
plugin. This script is meant to serve as an example of how to get started
with uri signing and could be useful in testing various configs.

(cherry picked from commit 3632eb748de4556dd87a66925ef2ace9a2b2c3fa)

Cherry-pick from commit 9c1b88a6349a84fa8556fc508d24bf6a25917fad

Cherry-pick from commit a139fd194eb2906a28781e5e7e1940a076ed60ce

Cherry-pick from commit c07474da86ddcd55bae6e93c03056232b8e2d69e

Add simple autest and subsequent fixes

(cherry picked from commit ea3aa04b88bbfea1412d8f2105c73c4eace763ee)

Cherry-pick from commit 6d64842e456adc95c0e0b7f123050b8c218d1454

URI Sig Null Check for Clang Warning (#6419)

This commit adds a missing null check in the uri normalization function.
This was caught by the clang analyzer.

(cherry picked from commit 2de1c35b036a8ee63a3abf74da9344076ac45425)

Syntax Error fixed in URI sig Plugin (#6420)

(cherry picked from commit c154d40e53949a53f0cf79626868075a9d330f68)

Change 

[trafficserver] branch 8.1.x updated: Fix build issues, VersioNumber was namespaced ...

2020-04-07 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new bdcd8e8  Fix build issues, VersioNumber was namespaced ...
bdcd8e8 is described below

commit bdcd8e8c73f7bf99aaa8a6174b2f8f23dcb64de5
Author: Leif Hedstrom 
AuthorDate: Tue Apr 7 09:39:15 2020 -0600

Fix build issues, VersioNumber was namespaced ...
---
 iocore/cache/Cache.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 7a2b26b..5ef523e 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -2141,7 +2141,7 @@ unmarshal_helper(Doc *doc, Ptr , int 
)
 {
   using UnmarshalFunc   = int(char *buf, int len, RefCountObj 
*block_ref);
   UnmarshalFunc *unmarshal_func = ::unmarshal;
-  ts::VersionNumber version(doc->v_major, doc->v_minor);
+  VersionNumber version(doc->v_major, doc->v_minor);
 
   // introduced by https://github.com/apache/trafficserver/pull/4874, this is 
used to distinguish the doc version
   // before and after #4847