[trafficserver] branch master updated (23174f4 -> 19dfdd4)

2021-05-17 Thread kichan
This is an automated email from the ASF dual-hosted git repository.

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


from 23174f4  Save and propagate epoll network error (#7809)
 add 19dfdd4  Clean up lua plugin doc for overridable configurations (#7844)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/plugins/lua.en.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


[trafficserver] branch master updated (fbdbb5b -> 23174f4)

2021-05-17 Thread shinrich
This is an automated email from the ASF dual-hosted git repository.

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


from fbdbb5b  Add method to write an IpAddr value to a sockaddr. (#7821)
 add 23174f4  Save and propagate epoll network error (#7809)

No new revisions were added by this update.

Summary of changes:
 iocore/net/NetEvent.h| 17 +
 iocore/net/UnixNet.cc| 19 ---
 iocore/net/UnixNetVConnection.cc | 12 
 3 files changed, 37 insertions(+), 11 deletions(-)


[trafficserver] branch master updated (7d39bfa -> fbdbb5b)

2021-05-17 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 7d39bfa  Add proxy.config.http.max_proxy_cycles (#7657)
 add fbdbb5b  Add method to write an IpAddr value to a sockaddr. (#7821)

No new revisions were added by this update.

Summary of changes:
 include/tscore/ink_inet.h | 10 ++
 src/tscore/ink_inet.cc| 21 +
 2 files changed, 31 insertions(+)


[trafficserver] branch master updated (d47d4dc -> 7d39bfa)

2021-05-17 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 d47d4dc  Update NextHop strategies so that unavailable server retry 
codes (#7837)
 add 7d39bfa  Add proxy.config.http.max_proxy_cycles (#7657)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/files/records.config.en.rst| 29 
 .../api/functions/TSHttpOverridableConfig.en.rst   |  1 +
 .../api/types/TSOverridableConfigKey.en.rst|  1 +
 include/ts/apidefs.h.in|  1 +
 mgmt/RecordsConfig.cc  |  2 +
 plugins/lua/ts_lua_http_config.c   |  2 +
 proxy/http/HttpConfig.cc   |  2 +
 proxy/http/HttpConfig.h|  1 +
 proxy/http/HttpTransact.cc | 77 ++
 src/shared/overridable_txn_vars.cc |  1 +
 src/traffic_server/InkAPI.cc   |  3 +
 src/traffic_server/InkAPITest.cc   |  1 +
 12 files changed, 95 insertions(+), 26 deletions(-)


[trafficserver] branch master updated (347f096 -> d47d4dc)

2021-05-17 Thread jrushford
This is an automated email from the ASF dual-hosted git repository.

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


from 347f096  generator: allow for POST requests (#7635)
 add d47d4dc  Update NextHop strategies so that unavailable server retry 
codes (#7837)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/files/strategies.yaml.en.rst   |  4 ++
 proxy/http/HttpTransact.cc | 10 +
 proxy/http/remap/NextHopSelectionStrategy.cc   | 52 +-
 proxy/http/remap/NextHopSelectionStrategy.h| 22 -
 proxy/http/remap/unit-tests/combined.yaml  |  7 ++-
 .../unit-tests/test_NextHopStrategyFactory.cc  |  7 ++-
 6 files changed, 70 insertions(+), 32 deletions(-)


[trafficserver] branch master updated (cc83e53 -> 347f096)

2021-05-17 Thread rrm
This is an automated email from the ASF dual-hosted git repository.

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


from cc83e53  Fixed double declaration types for log buffer tracking (#7847)
 add 347f096  generator: allow for POST requests (#7635)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/plugins/generator.en.rst |  11 +-
 plugins/generator/generator.cc   | 168 +--
 2 files changed, 147 insertions(+), 32 deletions(-)


[trafficserver] branch master updated (e728d0a -> cc83e53)

2021-05-17 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 e728d0a  Extra braces for clang 5 / ubuntu 16.04 on array 
initialization (#7842)
 add cc83e53  Fixed double declaration types for log buffer tracking (#7847)

No new revisions were added by this update.

Summary of changes:
 proxy/logging/LogBuffer.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


[trafficserver] branch 9.1.x updated: Fix the final consumer write size from unchunked to chunked tunnel (#7577)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new c06ef87  Fix the final consumer write size from unchunked to chunked 
tunnel (#7577)
c06ef87 is described below

commit c06ef871e7a23cf6877416690a164c17ab5a0909
Author: Susan Hinrichs 
AuthorDate: Mon Mar 8 22:28:12 2021 -0600

Fix the final consumer write size from unchunked to chunked tunnel (#7577)

(cherry picked from commit 8977a45054302b37bcc0d0a1cca3ad2dae98df6a)
---
 proxy/http/HttpTunnel.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index b08a25e..49a2530 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -1001,16 +1001,18 @@ HttpTunnel::producer_handler_dechunked(int event, 
HttpTunnelProducer *p)
 
   // We only interested in translating certain events
   switch (event) {
-  case VC_EVENT_READ_READY:
   case VC_EVENT_READ_COMPLETE:
   case HTTP_TUNNEL_EVENT_PRECOMPLETE:
   case VC_EVENT_EOS:
+p->alive = false; // Update the producer state for 
final_consumer_bytes_to_write
+/* fallthrough */
+  case VC_EVENT_READ_READY:
 p->last_event = p->chunked_handler.last_server_event = event;
 if (p->chunked_handler.generate_chunked_content()) { // We are done, make 
sure the consumer is activated
   HttpTunnelConsumer *c;
   for (c = p->consumer_list.head; c; c = c->link.next) {
 if (c->alive) {
-  c->write_vio->nbytes = p->chunked_handler.chunked_size;
+  c->write_vio->nbytes = final_consumer_bytes_to_write(p, c);
   // consumer_handler(VC_EVENT_WRITE_COMPLETE, c);
 }
   }


[trafficserver] branch 9.1.x updated: Call constructors and destructors for H1/2 Session/Transaction via ClassAllocator (#7584)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new a0dd3c2  Call constructors and destructors for H1/2 
Session/Transaction via ClassAllocator (#7584)
a0dd3c2 is described below

commit a0dd3c2a7e744bbcf5db6c1ba8321af85788329b
Author: Masakazu Kitajo 
AuthorDate: Thu Mar 11 07:48:24 2021 +0900

Call constructors and destructors for H1/2 Session/Transaction via 
ClassAllocator (#7584)

(cherry picked from commit d9807ddb610bc95194125113801c5efe8cbde47e)
---
 proxy/http/Http1ClientSession.cc| 3 +--
 proxy/http/Http1ClientSession.h | 2 +-
 proxy/http/Http1ServerSession.cc| 3 +--
 proxy/http/Http1ServerSession.h | 2 +-
 proxy/http/HttpSM.cc| 1 -
 proxy/http/HttpSessionAccept.cc | 1 -
 proxy/http2/Http2ClientSession.cc   | 3 +--
 proxy/http2/Http2ClientSession.h| 2 +-
 proxy/http2/Http2ConnectionState.cc | 4 ++--
 proxy/http2/Http2SessionAccept.cc   | 5 ++---
 proxy/http2/Http2Stream.cc  | 2 +-
 proxy/http2/Http2Stream.h   | 2 +-
 12 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc
index 541cc3a..300c112 100644
--- a/proxy/http/Http1ClientSession.cc
+++ b/proxy/http/Http1ClientSession.cc
@@ -55,7 +55,7 @@ ink_mutex debug_cs_list_mutex;
 
 #endif /* USE_HTTP_DEBUG_LISTS */
 
-ClassAllocator 
http1ClientSessionAllocator("http1ClientSessionAllocator");
+ClassAllocator 
http1ClientSessionAllocator("http1ClientSessionAllocator");
 
 Http1ClientSession::Http1ClientSession() : super(), trans(this) {}
 
@@ -118,7 +118,6 @@ Http1ClientSession::free()
 _vc = nullptr;
   }
 
-  this->~Http1ClientSession();
   THREAD_FREE(this, http1ClientSessionAllocator, this_thread());
 }
 
diff --git a/proxy/http/Http1ClientSession.h b/proxy/http/Http1ClientSession.h
index 1509806..4c4d0de 100644
--- a/proxy/http/Http1ClientSession.h
+++ b/proxy/http/Http1ClientSession.h
@@ -129,4 +129,4 @@ public:
   Http1Transaction trans;
 };
 
-extern ClassAllocator http1ClientSessionAllocator;
+extern ClassAllocator http1ClientSessionAllocator;
diff --git a/proxy/http/Http1ServerSession.cc b/proxy/http/Http1ServerSession.cc
index d800b03..eff73af 100644
--- a/proxy/http/Http1ServerSession.cc
+++ b/proxy/http/Http1ServerSession.cc
@@ -36,7 +36,7 @@
 #include "HttpSessionManager.h"
 #include "HttpSM.h"
 
-ClassAllocator 
httpServerSessionAllocator("httpServerSessionAllocator");
+ClassAllocator 
httpServerSessionAllocator("httpServerSessionAllocator");
 
 void
 Http1ServerSession::destroy()
@@ -50,7 +50,6 @@ Http1ServerSession::destroy()
   }
 
   mutex.clear();
-  this->~Http1ServerSession();
   if (httpSessionManager.get_pool_type() == 
TS_SERVER_SESSION_SHARING_POOL_THREAD) {
 THREAD_FREE(this, httpServerSessionAllocator, this_thread());
   } else {
diff --git a/proxy/http/Http1ServerSession.h b/proxy/http/Http1ServerSession.h
index 321ae7c..c74cc80 100644
--- a/proxy/http/Http1ServerSession.h
+++ b/proxy/http/Http1ServerSession.h
@@ -107,7 +107,7 @@ private:
   IOBufferReader *buf_reader = nullptr;
 };
 
-extern ClassAllocator httpServerSessionAllocator;
+extern ClassAllocator httpServerSessionAllocator;
 
 
 // INLINE
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 3a25ae2..6a6edf5 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1831,7 +1831,6 @@ HttpSM::state_http_server_open(int event, void *data)
 Http1ServerSession *session = (TS_SERVER_SESSION_SHARING_POOL_THREAD == 
httpSessionManager.get_pool_type()) ?
 
THREAD_ALLOC_INIT(httpServerSessionAllocator, mutex->thread_holding) :
 httpServerSessionAllocator.alloc();
-new (session) Http1ServerSession();
 session->sharing_pool  = 
static_cast(t_state.http_config_param->server_session_sharing_pool);
 session->sharing_match = 
static_cast(t_state.txn_conf->server_session_sharing_match);
 
diff --git a/proxy/http/HttpSessionAccept.cc b/proxy/http/HttpSessionAccept.cc
index c7d3b1f..ea9d075 100644
--- a/proxy/http/HttpSessionAccept.cc
+++ b/proxy/http/HttpSessionAccept.cc
@@ -50,7 +50,6 @@ HttpSessionAccept::accept(NetVConnection *netvc, MIOBuffer 
*iobuf, IOBufferReade
   }
 
   Http1ClientSession *new_session = 
THREAD_ALLOC_INIT(http1ClientSessionAllocator, this_ethread());
-  new (new_session) Http1ClientSession();
 
   new_session->accept_options = static_cast(this);
   new_session->acl= std::move(acl);
diff --git a/proxy/http2/Http2ClientSession.cc 
b/proxy/http2/Http2ClientSession.cc
index 434b4a3..1759be0 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -45,7 +45,7 @@
 this->session_handler = (handler); \
   } while 

[trafficserver] branch 9.1.x updated: Make Allocator.h less silly (no creepy "proto" object). (#6241)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new b24f62f  Make Allocator.h less silly (no creepy "proto" object). 
(#6241)
b24f62f is described below

commit b24f62f699d7ea9b7f4a6cd6168c005511fae666
Author: Walt Karas 
AuthorDate: Tue Mar 2 20:04:09 2021 -0600

Make Allocator.h less silly (no creepy "proto" object). (#6241)

Also make class and proxy allocators compatible with destructors.

(cherry picked from commit f51f8ed85443b595e379b2e0201095422082ba57)
---
 include/tscore/Allocator.h| 110 +-
 iocore/cache/P_CacheInternal.h|   2 +-
 iocore/eventsystem/I_ProxyAllocator.h |  96 ++---
 3 files changed, 77 insertions(+), 131 deletions(-)

diff --git a/include/tscore/Allocator.h b/include/tscore/Allocator.h
index c03f996..fd5200b 100644
--- a/include/tscore/Allocator.h
+++ b/include/tscore/Allocator.h
@@ -41,6 +41,7 @@
 
 #include 
 #include 
+#include 
 #include "tscore/ink_queue.h"
 #include "tscore/ink_defs.h"
 #include "tscore/ink_resource.h"
@@ -108,29 +109,39 @@ public:
 ink_freelist_madvise_init(>fl, name, element_size, chunk_size, 
alignment, advice);
   }
 
+  // Dummies
+  void
+  destroy_if_enabled(void *)
+  {
+  }
+  Allocator &
+  raw()
+  {
+return *this;
+  }
+
 protected:
   InkFreeList *fl;
 };
 
 /**
-  Allocator for Class objects. It uses a prototype object to do
-  fast initialization. Prototype of the template class is created
-  when the fast allocator is created. This is instantiated with
-  default (no argument) constructor. Constructor is not called for
-  the allocated objects. Instead, the prototype is just memory
-  copied onto the new objects. This is done for performance reasons.
+  Allocator for Class objects.
 
 */
-template  class ClassAllocator : public Allocator
+template  class ClassAllocator : 
private Allocator
 {
 public:
-  /** Allocates objects of the templated type. */
+  using Value_type   = C;
+  static bool const Destruct_on_free = Destruct_on_free_;
+
+  /** Allocates objects of the templated type.  Arguments are forwarded to the 
constructor for the object. */
+  template 
   C *
-  alloc()
+  alloc(Args &&... args)
   {
 void *ptr = ink_freelist_new(this->fl);
 
-memcpy(ptr, (void *)>proto.typeObject, sizeof(C));
+::new (ptr) C(std::forward(args)...);
 return (C *)ptr;
   }
 
@@ -142,82 +153,47 @@ public:
   void
   free(C *ptr)
   {
+destroy_if_enabled(ptr);
+
 ink_freelist_free(this->fl, ptr);
   }
 
   /**
-Deallocates objects of the templated type.
-
-@param head pointer to be freed.
-@param tail pointer to be freed.
-@param num_item of blocks to be freed.
-   */
-  void
-  free_bulk(C *head, C *tail, size_t num_item)
-  {
-ink_freelist_free_bulk(this->fl, head, tail, num_item);
-  }
+Create a new class specific ClassAllocator.
 
-  /**
-Allocate objects of the templated type via the inherited interface
-using void pointers.
+@param name some identifying name, used for mem tracking purposes.
+@param chunk_size number of units to be allocated if free pool is empty.
+@param alignment of objects must be a power of 2.
   */
-  void *
-  alloc_void()
+  ClassAllocator(const char *name, unsigned int chunk_size = 128, unsigned int 
alignment = 16)
   {
-return (void *)alloc();
+ink_freelist_init(>fl, name, RND16(sizeof(C)), chunk_size, 
RND16(alignment));
   }
 
-  /**
-Deallocate objects of the templated type via the inherited
-interface using void pointers.
-
-@param ptr pointer to be freed.
-  */
-  void
-  free_void(void *ptr)
+  Allocator &
+  raw()
   {
-free((C *)ptr);
+return *this;
   }
 
-  /**
-Deallocate objects of the templated type via the inherited
-interface using void pointers.
-
-@param head pointer to be freed.
-@param tail pointer to be freed.
-@param num_item of blocks.
-  */
   void
-  free_void_bulk(void *head, void *tail, size_t num_item)
+  destroy_if_enabled(C *ptr)
   {
-free_bulk((C *)head, (C *)tail, num_item);
-  }
-
-  /**
-Create a new class specific ClassAllocator.
-
-@param name some identifying name, used for mem tracking purposes.
-@param chunk_size number of units to be allocated if free pool is empty.
-@param alignment of objects must be a power of 2.
-  */
-  ClassAllocator(const char *name, unsigned int chunk_size = 128, unsigned int 
alignment = 16)
-  {
-::new ((void *)) C();
-ink_freelist_init(>fl, name, RND16(sizeof(C)), chunk_size, 
RND16(alignment));
+if (Destruct_on_free) {
+  ptr->~C();
+}
   }
 
-  struct {
-uint8_t typeObject[sizeof(C)];
-int64_t space_holder = 0;
-  } proto;
+  // Ensure that C is big enough to hold a void 

[trafficserver] branch 9.1.x updated: Disable compiling Inline.cc on macOS (#7389)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new 2371955  Disable compiling Inline.cc on macOS (#7389)
2371955 is described below

commit 23719550b007a4c53566c5e772b987281756eec5
Author: Randall Meyer 
AuthorDate: Tue Feb 16 12:27:57 2021 -0800

Disable compiling Inline.cc on macOS (#7389)

Allows builds on Apple Silicon to complete and run

(cherry picked from commit fa8b3f9a3081e6f51d4ae733c48348b9f988e7c8)
---
 iocore/aio/Inline.cc   | 2 ++
 iocore/cache/Inline.cc | 2 ++
 iocore/dns/Inline.cc   | 2 ++
 iocore/eventsystem/Inline.cc   | 2 ++
 iocore/eventsystem/unit_tests/test_IOBuffer.cc | 3 +++
 iocore/hostdb/Inline.cc| 2 ++
 iocore/net/Inline.cc   | 2 ++
 iocore/net/test_I_UDPNet.cc| 5 +
 8 files changed, 20 insertions(+)

diff --git a/iocore/aio/Inline.cc b/iocore/aio/Inline.cc
index 8e9b6d3..03ba7b0 100644
--- a/iocore/aio/Inline.cc
+++ b/iocore/aio/Inline.cc
@@ -26,5 +26,7 @@
  *
  */
 
+#if !defined(darwin)
 #define TS_INLINE
 #include "P_AIO.h"
+#endif
diff --git a/iocore/cache/Inline.cc b/iocore/cache/Inline.cc
index ecd72d2..80b7af8 100644
--- a/iocore/cache/Inline.cc
+++ b/iocore/cache/Inline.cc
@@ -26,5 +26,7 @@
  *
  */
 
+#if !defined(darwin)
 #define TS_INLINE
 #include "P_Cache.h"
+#endif
diff --git a/iocore/dns/Inline.cc b/iocore/dns/Inline.cc
index 27da8cd..c7142c7 100644
--- a/iocore/dns/Inline.cc
+++ b/iocore/dns/Inline.cc
@@ -26,5 +26,7 @@
  *
  */
 
+#if !defined(darwin)
 #define TS_INLINE
 #include "P_DNS.h"
+#endif
diff --git a/iocore/eventsystem/Inline.cc b/iocore/eventsystem/Inline.cc
index dc708c2..98a80a3 100644
--- a/iocore/eventsystem/Inline.cc
+++ b/iocore/eventsystem/Inline.cc
@@ -26,5 +26,7 @@
  *
  */
 
+#if !defined(darwin)
 #define TS_INLINE
 #include "P_EventSystem.h"
+#endif
diff --git a/iocore/eventsystem/unit_tests/test_IOBuffer.cc 
b/iocore/eventsystem/unit_tests/test_IOBuffer.cc
index 1c2c407..0fc3518 100644
--- a/iocore/eventsystem/unit_tests/test_IOBuffer.cc
+++ b/iocore/eventsystem/unit_tests/test_IOBuffer.cc
@@ -28,6 +28,9 @@
 
 #include "I_EventSystem.h"
 #include "RecordsConfig.h"
+#if defined(darwin)
+#include "P_IOBuffer.h"
+#endif
 
 #include "diags.i"
 
diff --git a/iocore/hostdb/Inline.cc b/iocore/hostdb/Inline.cc
index dd8fb46..17cb3fe 100644
--- a/iocore/hostdb/Inline.cc
+++ b/iocore/hostdb/Inline.cc
@@ -26,5 +26,7 @@
  *
  */
 
+#if !defined(darwin)
 #define TS_INLINE
 #include "P_HostDB.h"
+#endif
diff --git a/iocore/net/Inline.cc b/iocore/net/Inline.cc
index 96716d6..fe9fe52 100644
--- a/iocore/net/Inline.cc
+++ b/iocore/net/Inline.cc
@@ -26,5 +26,7 @@
  *
  */
 
+#if !defined(darwin)
 #define TS_INLINE
 #include "P_Net.h"
+#endif
diff --git a/iocore/net/test_I_UDPNet.cc b/iocore/net/test_I_UDPNet.cc
index dca7e0a..39f6c11 100644
--- a/iocore/net/test_I_UDPNet.cc
+++ b/iocore/net/test_I_UDPNet.cc
@@ -31,8 +31,13 @@
 #include "I_EventSystem.h"
 #include "I_Net.h"
 #include "I_UDPNet.h"
+#if defined(darwin)
+#include "P_UDPConnection.h"
+#include "P_UDPPacket.h"
+#else
 #include "I_UDPPacket.h"
 #include "I_UDPConnection.h"
+#endif
 
 #include "diags.i"
 


[trafficserver] branch 9.1.x updated: Augment test cases for tls_verify_override test (#7736)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new 8f0bcb9  Augment test cases for tls_verify_override test (#7736)
8f0bcb9 is described below

commit 8f0bcb914ad60af9764fe4daf09aa4f9d7e03778
Author: Susan Hinrichs 
AuthorDate: Wed May 5 16:28:20 2021 -0500

Augment test cases for tls_verify_override test (#7736)

(cherry picked from commit 5b2113b461f8aedb78e83a6ec65245928be17de9)
---
 tests/gold_tests/tls/tls_verify_override.test.py | 67 
 1 file changed, 45 insertions(+), 22 deletions(-)

diff --git a/tests/gold_tests/tls/tls_verify_override.test.py 
b/tests/gold_tests/tls/tls_verify_override.test.py
index e9b3fa2..2a642a4 100644
--- a/tests/gold_tests/tls/tls_verify_override.test.py
+++ b/tests/gold_tests/tls/tls_verify_override.test.py
@@ -67,9 +67,15 @@ ts.Disk.remap_config.AddLine(
 'map http://bar.com/overridedisabled https://bar.com:{0} 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.policy=DISABLED'.format(
 server_foo.Variables.SSL_Port))
 ts.Disk.remap_config.AddLine(
+'map http://bad_bar.com/overridedisabled https://bar.com:{0} 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.policy=DISABLED'.format(
+server_foo.Variables.SSL_Port))
+ts.Disk.remap_config.AddLine(
 'map http://bar.com/overridesignature https://bar.com:{0} 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.properties=SIGNATURE 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.policy=ENFORCED'.format(
 server_foo.Variables.SSL_Port))
 ts.Disk.remap_config.AddLine(
+'map http://bar.com/overridenone https://bar.com:{0} @plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.properties=NONE 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.policy=ENFORCED"'.format(
+server_foo.Variables.SSL_Port))
+ts.Disk.remap_config.AddLine(
 'map http://bar.com/overrideenforced https://bar.com:{0} 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.policy=ENFORCED'.format(
 server_foo.Variables.SSL_Port))
 ts.Disk.remap_config.AddLine(
@@ -114,7 +120,7 @@ ts.Disk.records_config.update({
 'proxy.config.dns.nameservers': '127.0.0.1:{0}'.format(dns.Variables.Port),
 'proxy.config.dns.resolv_conf': 'NULL',
 'proxy.config.exec_thread.autoconfig.scale': 1.0,
-'proxy.config.ssl.client.sni_policy': 'remap'
+'proxy.config.ssl.client.sni_policy': 'remap',
 })
 
 dns.addRecords(records={"foo.com.": ["127.0.0.1"]})
@@ -127,7 +133,7 @@ tr.Setup.Copy("ssl/signed-foo.key")
 tr.Setup.Copy("ssl/signed-foo.pem")
 tr.Setup.Copy("ssl/signed-bar.key")
 tr.Setup.Copy("ssl/signed-bar.pem")
-tr.Processes.Default.Command = 'curl -k -H \"host: foo.com\"  
http://127.0.0.1:{0}/basic'.format(ts.Variables.port)
+tr.Processes.Default.Command = 'curl -v -k -H \"host: foo.com\"  
http://127.0.0.1:{0}/basic'.format(ts.Variables.port)
 tr.ReturnCode = 0
 tr.Processes.Default.StartBefore(dns)
 tr.Processes.Default.StartBefore(server_foo)
@@ -137,23 +143,26 @@ tr.Processes.Default.StartBefore(Test.Processes.ts)
 tr.StillRunningAfter = server
 tr.StillRunningAfter = ts
 # Should succed.  No message
-tr.Processes.Default.Streams.stdout = Testers.ExcludesExpression("Could Not 
Connect", "Curl attempt should have succeeded")
+tr.Processes.Default.Streams.All = Testers.ExcludesExpression("Could Not 
Connect", "Curl attempt should have succeeded")
+tr.Processes.Default.Streams.All += Testers.ContainsExpression("200 OK", "Curl 
attempt should have succeeded")
 
 tr2 = Test.AddTestRun("default-permissive-fail")
-tr2.Processes.Default.Command = "curl -k -H \"host: bar.com\"  
http://127.0.0.1:{0}/basic".format(ts.Variables.port)
+tr2.Processes.Default.Command = "curl -v -k -H \"host: bar.com\"  
http://127.0.0.1:{0}/basic".format(ts.Variables.port)
 tr2.ReturnCode = 0
 tr2.StillRunningAfter = server
 tr2.StillRunningAfter = ts
 # Should succeed, but will be message in log about name mismatch
-tr2.Processes.Default.Streams.stdout = Testers.ExcludesExpression("Could Not 
Connect", "Curl attempt should have succeeded")
+tr2.Processes.Default.Streams.All = Testers.ExcludesExpression("Could Not 
Connect", "Curl attempt should have succeeded")
+tr2.Processes.Default.Streams.All += Testers.ContainsExpression("200 OK", 
"Curl attempt should have succeeded")
 
 tr2 = Test.AddTestRun("default-permissive-fail2")
-tr2.Processes.Default.Command = "curl -k -H \"host: random.com\"  
http://127.0.0.1:{0}/basic".format(ts.Variables.port)
+tr2.Processes.Default.Command = "curl -v -k -H \"host: random.com\"  
http://127.0.0.1:{0}/basic".format(ts.Variables.port)
 tr2.ReturnCode = 0
 tr2.StillRunningAfter = server
 tr2.StillRunningAfter = ts
 # Should succeed, but 

[trafficserver] branch 9.1.x updated: Remove extra verify-callback (#7540)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new 70d68f9  Remove extra verify-callback (#7540)
70d68f9 is described below

commit 70d68f93bef76f63c9c33a30867cb7f28297e4bb
Author: Susan Hinrichs 
AuthorDate: Wed May 5 16:29:18 2021 -0500

Remove extra verify-callback (#7540)

(cherry picked from commit f7939769974a54969c18159d65d9ba05a07331f7)
---
 iocore/net/SSLClientUtils.cc  | 1 -
 tests/gold_tests/tls/tls_client_cert_override.test.py | 2 ++
 tests/gold_tests/tls/tls_verify_override.test.py  | 2 ++
 tests/gold_tests/tls/tls_verify_override_base.test.py | 2 ++
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/iocore/net/SSLClientUtils.cc b/iocore/net/SSLClientUtils.cc
index 012db75..cf522fe 100644
--- a/iocore/net/SSLClientUtils.cc
+++ b/iocore/net/SSLClientUtils.cc
@@ -200,7 +200,6 @@ SSLInitClientContext(const SSLConfigParams *params)
   }
 #endif
 
-  SSL_CTX_set_verify(client_ctx, SSL_VERIFY_PEER, verify_callback);
   SSL_CTX_set_verify_depth(client_ctx, params->client_verify_depth);
   if (SSLConfigParams::init_ssl_ctx_cb) {
 SSLConfigParams::init_ssl_ctx_cb(client_ctx, false);
diff --git a/tests/gold_tests/tls/tls_client_cert_override.test.py 
b/tests/gold_tests/tls/tls_client_cert_override.test.py
index f04f357..17688ef 100644
--- a/tests/gold_tests/tls/tls_client_cert_override.test.py
+++ b/tests/gold_tests/tls/tls_client_cert_override.test.py
@@ -68,6 +68,8 @@ ts.addSSLfile("ssl/signed2-bar.pem")
 ts.addSSLfile("ssl/signed-bar.key")
 
 ts.Disk.records_config.update({
+'proxy.config.diags.debug.enabled': 1,
+'proxy.config.diags.debug.tags': 'ssl',
 'proxy.config.ssl.server.cert.path': '{0}'.format(ts.Variables.SSLDir),
 'proxy.config.ssl.server.private_key.path': 
'{0}'.format(ts.Variables.SSLDir),
 'proxy.config.ssl.server.cipher_suite': 
'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:RC4-SHA:RC4-MD5:AES128-SHA:AES256-SHA:DES-CBC3-SHA!SRP:!DSS:!PSK:!aNULL:!eNULL:!SSLv2',
diff --git a/tests/gold_tests/tls/tls_verify_override.test.py 
b/tests/gold_tests/tls/tls_verify_override.test.py
index e4daffc..e9b3fa2 100644
--- a/tests/gold_tests/tls/tls_verify_override.test.py
+++ b/tests/gold_tests/tls/tls_verify_override.test.py
@@ -100,6 +100,8 @@ ts.Disk.ssl_multicert_config.AddLine(
 # Case 1, global config policy=permissive properties=signature
 # override for foo.com policy=enforced properties=all
 ts.Disk.records_config.update({
+'proxy.config.diags.debug.enabled': 1,
+'proxy.config.diags.debug.tags': 'ssl',
 'proxy.config.ssl.server.cert.path': '{0}'.format(ts.Variables.SSLDir),
 'proxy.config.ssl.server.private_key.path': 
'{0}'.format(ts.Variables.SSLDir),
 'proxy.config.ssl.server.cipher_suite': 
'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:RC4-SHA:RC4-MD5:AES128-SHA:AES256-SHA:DES-CBC3-SHA!SRP:!DSS:!PSK:!aNULL:!eNULL:!SSLv2',
diff --git a/tests/gold_tests/tls/tls_verify_override_base.test.py 
b/tests/gold_tests/tls/tls_verify_override_base.test.py
index b5d06d4..874d177 100644
--- a/tests/gold_tests/tls/tls_verify_override_base.test.py
+++ b/tests/gold_tests/tls/tls_verify_override_base.test.py
@@ -104,6 +104,8 @@ ts.Disk.ssl_multicert_config.AddLine(
 # Case 1, global config policy=permissive properties=signature
 # override for foo.com policy=enforced properties=all
 ts.Disk.records_config.update({
+'proxy.config.diags.debug.enabled': 1,
+'proxy.config.diags.debug.tags': 'ssl',
 'proxy.config.ssl.server.cert.path': '{0}'.format(ts.Variables.SSLDir),
 'proxy.config.ssl.server.private_key.path': 
'{0}'.format(ts.Variables.SSLDir),
 'proxy.config.ssl.server.cipher_suite': 
'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:RC4-SHA:RC4-MD5:AES128-SHA:AES256-SHA:DES-CBC3-SHA!SRP:!DSS:!PSK:!aNULL:!eNULL:!SSLv2',


[trafficserver] branch 9.1.x updated: Fix MLoc assert caused by s3auth (#7790)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new 7ba2270  Fix MLoc assert caused by s3auth (#7790)
7ba2270 is described below

commit 7ba2270458b2900dd85af2b345c97d35089c3f85
Author: Susan Hinrichs 
AuthorDate: Tue May 11 10:10:07 2021 -0500

Fix MLoc assert caused by s3auth (#7790)

(cherry picked from commit 7eaefc923014e2e3808abcd89433640ce0a41d54)
---
 plugins/s3_auth/s3_auth.cc | 54 +-
 1 file changed, 29 insertions(+), 25 deletions(-)

diff --git a/plugins/s3_auth/s3_auth.cc b/plugins/s3_auth/s3_auth.cc
index b0cbe243..3f47d8c 100644
--- a/plugins/s3_auth/s3_auth.cc
+++ b/plugins/s3_auth/s3_auth.cc
@@ -991,36 +991,40 @@ S3Request::authorizeV2(S3Config *s3)
 int
 event_handler(TSCont cont, TSEvent event, void *edata)
 {
-  TSHttpTxn txnp = static_cast(edata);
-  S3Config *s3   = static_cast(TSContDataGet(cont));
-
-  S3Request request(txnp);
-  TSHttpStatus status  = TS_HTTP_STATUS_INTERNAL_SERVER_ERROR;
+  TSHttpTxn txnp   = static_cast(edata);
+  S3Config *s3 = static_cast(TSContDataGet(cont));
   TSEvent enable_event = TS_EVENT_HTTP_CONTINUE;
 
-  switch (event) {
-  case TS_EVENT_HTTP_SEND_REQUEST_HDR:
-if (request.initialize()) {
-  while (s3->reload_waiting) {
-std::this_thread::yield();
-  }
+  {
+S3Request request(txnp);
+TSHttpStatus status = TS_HTTP_STATUS_INTERNAL_SERVER_ERROR;
 
-  std::shared_lock lock(s3->reload_mutex);
-  status = request.authorize(s3);
-}
+switch (event) {
+case TS_EVENT_HTTP_SEND_REQUEST_HDR:
+  if (request.initialize()) {
+while (s3->reload_waiting) {
+  std::this_thread::yield();
+}
 
-if (TS_HTTP_STATUS_OK == status) {
-  TSDebug(PLUGIN_NAME, "Successfully signed the AWS S3 URL");
-} else {
-  TSDebug(PLUGIN_NAME, "Failed to sign the AWS S3 URL, status = %d", 
status);
-  TSHttpTxnStatusSet(txnp, status);
-  enable_event = TS_EVENT_HTTP_ERROR;
+std::shared_lock lock(s3->reload_mutex);
+status = request.authorize(s3);
+  }
+
+  if (TS_HTTP_STATUS_OK == status) {
+TSDebug(PLUGIN_NAME, "Successfully signed the AWS S3 URL");
+  } else {
+TSDebug(PLUGIN_NAME, "Failed to sign the AWS S3 URL, status = %d", 
status);
+TSHttpTxnStatusSet(txnp, status);
+enable_event = TS_EVENT_HTTP_ERROR;
+  }
+  break;
+default:
+  TSError("[%s] Unknown event for this plugin", PLUGIN_NAME);
+  TSDebug(PLUGIN_NAME, "unknown event for this plugin");
+  break;
 }
-break;
-  default:
-TSError("[%s] Unknown event for this plugin", PLUGIN_NAME);
-TSDebug(PLUGIN_NAME, "unknown event for this plugin");
-break;
+// Most get S3Request out of scope in case the later plugins invalidate 
the TSAPI
+// objects it references.  Some cases were causing asserts from the 
destructor
   }
 
   TSHttpTxnReenable(txnp, enable_event);


[trafficserver] branch 9.1.x updated: AuTest: use exteneded help output to determin curl feature support (#7834)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new 54acdd7  AuTest: use exteneded help output to determin curl feature 
support (#7834)
54acdd7 is described below

commit 54acdd7347541e08bc0c65d997576c61479c690b
Author: Brian Neradt 
AuthorDate: Thu May 13 16:05:16 2021 -0500

AuTest: use exteneded help output to determin curl feature support (#7834)

I ran the AuTest suite with a recent development version of curl and
noticed that the proxy_protocol.test.py test was skipped because it
thought that the built curl version didn't have haproxy-protocol
support. It did have this support, but that version of curl didn't show
that option in the brief `--help` output but it was shown if `--help
all` was used. This change makes checking curl feature support use
`--help all` for all feature requests.

(cherry picked from commit fa6aa624a80184b16b105c860d5565f1bb872636)
---
 tests/gold_tests/autest-site/conditions.test.ext | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gold_tests/autest-site/conditions.test.ext 
b/tests/gold_tests/autest-site/conditions.test.ext
index 52af993..e182e69 100644
--- a/tests/gold_tests/autest-site/conditions.test.ext
+++ b/tests/gold_tests/autest-site/conditions.test.ext
@@ -79,7 +79,7 @@ def HasCurlOption(self, option):
 return False
 
 return self.CheckOutput(
-['curl', '--help'],
+['curl', '--help', 'all'],
 default,
 "Curl needs to support option: {option}".format(option=option)
 )


[trafficserver] branch 9.1.x updated: Fix so EOS are delivered to sessions in the pool (#7828)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new 83897d2  Fix so EOS are delivered to sessions in the pool (#7828)
83897d2 is described below

commit 83897d25d4043aa5b5dce33e7568dcebe7210a15
Author: Susan Hinrichs 
AuthorDate: Fri May 14 08:58:59 2021 -0500

Fix so EOS are delivered to sessions in the pool (#7828)

(cherry picked from commit 9a7742a3a59adfacb068b49d315b5f81c2c7944f)
---
 proxy/PoolableSession.h  | 2 ++
 proxy/http/Http1ClientSession.cc | 2 +-
 proxy/http/Http1ServerSession.h  | 2 +-
 proxy/http/HttpSessionManager.cc | 4 +++-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/proxy/PoolableSession.h b/proxy/PoolableSession.h
index 76946ef..802ddb3 100644
--- a/proxy/PoolableSession.h
+++ b/proxy/PoolableSession.h
@@ -83,6 +83,8 @@ public:
 
   void set_netvc(NetVConnection *newvc);
 
+  virtual IOBufferReader *get_reader() = 0;
+
 private:
   // Sessions become if authentication headers
   //  are sent over them
diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc
index cc28aee..541cc3a 100644
--- a/proxy/http/Http1ClientSession.cc
+++ b/proxy/http/Http1ClientSession.cc
@@ -467,7 +467,7 @@ Http1ClientSession::attach_server_session(PoolableSession 
*ssession, bool transa
 //  have it call the client session back.  This IO also prevent
 //  the server net conneciton from calling back a dead sm
 SET_HANDLER(::state_keep_alive);
-slave_ka_vio = ssession->do_io_read(this, 0, nullptr);
+slave_ka_vio = ssession->do_io_read(this, INT64_MAX, 
ssession->get_reader()->mbuf);
 ink_assert(slave_ka_vio != ka_vio);
 
 // Transfer control of the write side as well
diff --git a/proxy/http/Http1ServerSession.h b/proxy/http/Http1ServerSession.h
index 95e7ebc..321ae7c 100644
--- a/proxy/http/Http1ServerSession.h
+++ b/proxy/http/Http1ServerSession.h
@@ -76,7 +76,7 @@ public:
   void start() override;
 
   void enable_outbound_connection_tracking(OutboundConnTrack::Group *group);
-  IOBufferReader *get_reader();
+  IOBufferReader *get_reader() override;
   void attach_hostname(const char *hostname);
   IpEndpoint const _server_ip() const;
 
diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc
index dd56397..07be658 100644
--- a/proxy/http/HttpSessionManager.cc
+++ b/proxy/http/HttpSessionManager.cc
@@ -206,7 +206,9 @@ ServerSessionPool::releaseSession(PoolableSession *ss)
   //  if it closes on us.  We will get called back in the
   //  continuation for this bucket, ensuring we have the lock
   //  to remove the connection from our lists
-  ss->do_io_read(this, 0, nullptr);
+  //  Actually need to have a buffer here, otherwise the vc is
+  //  disabled
+  ss->do_io_read(this, INT64_MAX, ss->get_reader()->mbuf);
 
   // Transfer control of the write side as well
   ss->do_io_write(this, 0, nullptr);


[trafficserver] branch 9.1.x updated: Remove unused member from HttpSM (#7835)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new ed780f2  Remove unused member from HttpSM (#7835)
ed780f2 is described below

commit ed780f2d48b87cba83a9b7ca3bbdca83f0946742
Author: Susan Hinrichs 
AuthorDate: Thu May 13 18:27:20 2021 -0500

Remove unused member from HttpSM (#7835)

(cherry picked from commit 8585adf9faecf098c364f343a568c01341bbbc2b)
---
 proxy/http/HttpSM.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 9f0d3ca..cc18af4 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -424,7 +424,6 @@ protected:
* we should create a new connection and then once we attach the session 
we'll mark it as private.
*/
   bool will_be_private_ss  = false;
-  int shared_session_retries   = 0;
   IOBufferReader *server_buffer_reader = nullptr;
 
   HttpTransformInfo transform_info;


[trafficserver] branch 9.1.x updated: Fix a format specifier for size_t (#7830)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new dd7f480  Fix a format specifier for size_t (#7830)
dd7f480 is described below

commit dd7f480f68dce97710cdb9e0f520f7c2e001b14c
Author: Masakazu Kitajo 
AuthorDate: Fri May 14 09:29:33 2021 +0900

Fix a format specifier for size_t (#7830)

(cherry picked from commit 73d179a3afd8f39d150829f62227c0b0107984c2)
---
 proxy/http/HttpSessionManager.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc
index 4f7fabb..dd56397 100644
--- a/proxy/http/HttpSessionManager.cc
+++ b/proxy/http/HttpSessionManager.cc
@@ -147,7 +147,7 @@ ServerSessionPool::acquireSession(sockaddr const *addr, 
CryptoHash const 
   to_return= nullptr;
 
   if ((TS_SERVER_SESSION_SHARING_MATCH_MASK_HOSTONLY & match_style) && 
!(TS_SERVER_SESSION_SHARING_MATCH_MASK_IP & match_style)) {
-Debug("http_ss", "Search for host name only not IP.  Pool size %" PRId64, 
m_fqdn_pool.count());
+Debug("http_ss", "Search for host name only not IP.  Pool size %zu", 
m_fqdn_pool.count());
 // This is broken out because only in this case do we check the host hash 
first. The range must be checked
 // to verify an upstream that matches port and SNI name is selected. Walk 
backwards to select oldest.
 in_port_t port = ats_ip_port_cast(addr);


[trafficserver] branch 9.1.x updated: Address assert on captive_action (#7807)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new fa0e539  Address assert on captive_action (#7807)
fa0e539 is described below

commit fa0e539873b771deb11ae3056bf44cc581f19e1a
Author: Susan Hinrichs 
AuthorDate: Fri May 14 08:59:59 2021 -0500

Address assert on captive_action (#7807)

(cherry picked from commit eb765c0905b17fdae133c87908bc97c843766530)
---
 proxy/http/HttpCacheSM.cc | 33 +
 proxy/http/HttpCacheSM.h  |  9 +
 proxy/http/HttpSM.cc  |  8 ++--
 proxy/http/HttpSM.h   |  7 +++
 4 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/proxy/http/HttpCacheSM.cc b/proxy/http/HttpCacheSM.cc
index 2bab3be..025b8ee 100644
--- a/proxy/http/HttpCacheSM.cc
+++ b/proxy/http/HttpCacheSM.cc
@@ -101,6 +101,10 @@ HttpCacheSM::state_cache_open_read(int event, void *data)
   ink_assert(captive_action.cancelled == 0);
   pending_action = nullptr;
 
+  if (captive_action.cancelled == 1) {
+return VC_EVENT_CONT; // SM gave up on us
+  }
+
   switch (event) {
   case CACHE_EVENT_OPEN_READ:
 HTTP_INCREMENT_DYN_STAT(http_current_cache_connections_stat);
@@ -111,10 +115,11 @@ HttpCacheSM::state_cache_open_read(int event, void *data)
 }
 open_read_cb  = true;
 cache_read_vc = static_cast(data);
-master_sm->handleEvent(event, data);
+master_sm->handleEvent(event, _action);
 break;
 
   case CACHE_EVENT_OPEN_READ_FAILED:
+err_code = reinterpret_cast(data);
 if ((intptr_t)data == -ECACHE_DOC_BUSY) {
   // Somebody else is writing the object
   if (open_read_tries <= 
master_sm->t_state.txn_conf->max_cache_open_read_retries) {
@@ -125,12 +130,12 @@ HttpCacheSM::state_cache_open_read(int event, void *data)
 // Give up; the update didn't finish in time
 // HttpSM will inform HttpTransact to 'proxy-only'
 open_read_cb = true;
-master_sm->handleEvent(event, data);
+master_sm->handleEvent(event, _action);
   }
 } else {
   // Simple miss in the cache.
   open_read_cb = true;
-  master_sm->handleEvent(event, data);
+  master_sm->handleEvent(event, _action);
 }
 break;
 
@@ -159,7 +164,11 @@ HttpCacheSM::state_cache_open_write(int event, void *data)
 {
   STATE_ENTER(::state_cache_open_write, event);
   ink_assert(captive_action.cancelled == 0);
-  pending_action= nullptr;
+  pending_action = nullptr;
+
+  if (captive_action.cancelled == 1) {
+return VC_EVENT_CONT; // SM gave up on us
+  }
   bool read_retry_on_write_fail = false;
 
   switch (event) {
@@ -168,7 +177,7 @@ HttpCacheSM::state_cache_open_write(int event, void *data)
 ink_assert(cache_write_vc == nullptr);
 cache_write_vc = static_cast(data);
 open_write_cb  = true;
-master_sm->handleEvent(event, data);
+master_sm->handleEvent(event, _action);
 break;
 
   case CACHE_EVENT_OPEN_WRITE_FAILED:
@@ -196,8 +205,6 @@ HttpCacheSM::state_cache_open_write(int event, void *data)
 if (read_retry_on_write_fail || open_write_tries <= 
master_sm->t_state.txn_conf->max_cache_open_write_retries) {
   // Retry open write;
   open_write_cb = false;
-  // reset captive_action since HttpSM cancelled it
-  captive_action.cancelled = 0;
   do_schedule_in();
 } else {
   // The cache is hosed or full or something.
@@ -207,7 +214,8 @@ HttpCacheSM::state_cache_open_write(int event, void *data)
 "done retrying...",
 master_sm->sm_id, open_write_tries);
   open_write_cb = true;
-  master_sm->handleEvent(event, data);
+  err_code  = reinterpret_cast(data);
+  master_sm->handleEvent(event, _action);
 }
 break;
 
@@ -218,7 +226,7 @@ HttpCacheSM::state_cache_open_write(int event, void *data)
 "falling back to read retry...",
 master_sm->sm_id, open_write_tries);
   open_read_cb = false;
-  master_sm->handleEvent(CACHE_EVENT_OPEN_READ, data);
+  master_sm->handleEvent(CACHE_EVENT_OPEN_READ, _action);
 } else {
   Debug("http_cache",
 "[%" PRId64 "] [state_cache_open_write] cache open write failure 
%d. "
@@ -266,8 +274,6 @@ HttpCacheSM::do_cache_open_read(const HttpCacheKey )
   } else {
 ink_assert(open_read_cb == false);
   }
-  // reset captive_action since HttpSM cancelled it during open read retry
-  captive_action.cancelled = 0;
   // Initialising read-while-write-inprogress flag
   this->readwhilewrite_inprogress = false;
   Action *action_handle = cacheProcessor.open_read(this, , 
this->read_request_hdr, this->http_params, this->read_pin_in_cache);
@@ -283,6 +289,7 @@ HttpCacheSM::do_cache_open_read(const HttpCacheKey )
 return ACTION_RESULT_DONE;
   } else {
 ink_assert(pending_action != nullptr || 

[trafficserver] 02/02: Extra braces for clang 5 / ubuntu 16.04 on array initialization (#7842)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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

commit bd8dc1a212251a97d015c9638898c1cf92ac2d71
Author: Bryan Call 
AuthorDate: Mon May 17 07:50:52 2021 -0700

Extra braces for clang 5 / ubuntu 16.04 on array initialization (#7842)

(cherry picked from commit e728d0a2614b940821a1a401176b3a9612a5b5f1)
---
 src/tscore/Regex.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tscore/Regex.cc b/src/tscore/Regex.cc
index ea80116..1fe1e31 100644
--- a/src/tscore/Regex.cc
+++ b/src/tscore/Regex.cc
@@ -111,7 +111,7 @@ Regex::get_capture_count()
 bool
 Regex::exec(std::string_view const )
 {
-  std::array ovector = {0};
+  std::array ovector = {{0}};
   return this->exec(str, ovector.data(), ovector.size());
 }
 


[trafficserver] branch 9.1.x updated (23e7a04 -> bd8dc1a)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


from 23e7a04  Don't call next next dup on destroyed mime field mloc. (#7833)
 new 57ea17d  Fixed warning in gcc 11 about array not being initalized 
(#7840)
 new bd8dc1a  Extra braces for clang 5 / ubuntu 16.04 on array 
initialization (#7842)

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:
 src/tscore/Regex.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[trafficserver] 01/02: Fixed warning in gcc 11 about array not being initalized (#7840)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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

commit 57ea17df44a4196f9ee1f82417e0dc916e6f8a2c
Author: Bryan Call 
AuthorDate: Fri May 14 12:55:20 2021 -0700

Fixed warning in gcc 11 about array not being initalized (#7840)

(cherry picked from commit db75f1869883614b49cd6276edcb138e44af7cad)
---
 src/tscore/Regex.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tscore/Regex.cc b/src/tscore/Regex.cc
index 9d93c8d..ea80116 100644
--- a/src/tscore/Regex.cc
+++ b/src/tscore/Regex.cc
@@ -111,7 +111,7 @@ Regex::get_capture_count()
 bool
 Regex::exec(std::string_view const )
 {
-  std::array ovector;
+  std::array ovector = {0};
   return this->exec(str, ovector.data(), ovector.size());
 }
 


[trafficserver] branch master updated: Extra braces for clang 5 / ubuntu 16.04 on array initialization (#7842)

2021-05-17 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 e728d0a  Extra braces for clang 5 / ubuntu 16.04 on array 
initialization (#7842)
e728d0a is described below

commit e728d0a2614b940821a1a401176b3a9612a5b5f1
Author: Bryan Call 
AuthorDate: Mon May 17 07:50:52 2021 -0700

Extra braces for clang 5 / ubuntu 16.04 on array initialization (#7842)
---
 src/tscore/Regex.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tscore/Regex.cc b/src/tscore/Regex.cc
index ea80116..1fe1e31 100644
--- a/src/tscore/Regex.cc
+++ b/src/tscore/Regex.cc
@@ -111,7 +111,7 @@ Regex::get_capture_count()
 bool
 Regex::exec(std::string_view const )
 {
-  std::array ovector = {0};
+  std::array ovector = {{0}};
   return this->exec(str, ovector.data(), ovector.size());
 }
 


[trafficserver] branch 9.0.x updated: Updated ChangeLog

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


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

commit 83a359a6986f672fe7ea01e2837b4e800f4a70e1
Author: Leif Hedstrom 
AuthorDate: Mon May 17 08:37:45 2021 -0600

Updated ChangeLog
---
 CHANGELOG-9.0.2 | 4 
 1 file changed, 4 insertions(+)

diff --git a/CHANGELOG-9.0.2 b/CHANGELOG-9.0.2
index 2594188..8efdff3 100644
--- a/CHANGELOG-9.0.2
+++ b/CHANGELOG-9.0.2
@@ -11,3 +11,7 @@ Changes with Apache Traffic Server 9.0.2
   #7730 - Fix build on FreeBSD 13
   #7745 - Fixes errors in the strategies.yaml documentation.
   #7749 - Fixes Issue #7739 - Next hop strategy with bad 'to' URL causes TS 
crash.
+  #7760 - doc: header_rewrite random function not inclusive
+  #7805 - Doc: tcpinfo plugin table formatting
+  #7825 - Eliminate next dup call using stale mime field mloc in s3_auth 
plugin.
+  #7833 - Don't call next next dup on destroyed mime field mloc.


[trafficserver] branch 9.1.x updated: Don't call next next dup on destroyed mime field mloc. (#7833)

2021-05-17 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
 new 23e7a04  Don't call next next dup on destroyed mime field mloc. (#7833)
23e7a04 is described below

commit 23e7a04b2ab4690b61283b958026de34a0620dc0
Author: Walt Karas 
AuthorDate: Fri May 14 11:02:46 2021 -0500

Don't call next next dup on destroyed mime field mloc. (#7833)

plugins/background_fetch/headers.cc
plugins/cache_range_requests/cache_range_requests.cc
plugins/experimental/access_control/headers.cc
plugins/experimental/cache_fill/background_fetch.cc
plugins/header_rewrite/operators.cc
plugins/prefetch/headers.cc

(cherry picked from commit dc10eae8a85e9b1c3436d15bb97219e98b41d42e)
---
 plugins/background_fetch/headers.cc  | 2 +-
 plugins/cache_range_requests/cache_range_requests.cc | 2 +-
 plugins/experimental/access_control/headers.cc   | 2 +-
 plugins/experimental/cache_fill/background_fetch.cc  | 2 +-
 plugins/header_rewrite/operators.cc  | 2 +-
 plugins/prefetch/headers.cc  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/plugins/background_fetch/headers.cc 
b/plugins/background_fetch/headers.cc
index 4317d9d..a134187 100644
--- a/plugins/background_fetch/headers.cc
+++ b/plugins/background_fetch/headers.cc
@@ -75,6 +75,7 @@ set_header(TSMBuffer bufp, TSMLoc hdr_loc, const char 
*header, int len, const ch
 bool first = true;
 
 while (field_loc) {
+  tmp = TSMimeHdrFieldNextDup(bufp, hdr_loc, field_loc);
   if (first) {
 first = false;
 if (TS_SUCCESS == TSMimeHdrFieldValueStringSet(bufp, hdr_loc, 
field_loc, -1, val, val_len)) {
@@ -83,7 +84,6 @@ set_header(TSMBuffer bufp, TSMLoc hdr_loc, const char 
*header, int len, const ch
   } else {
 TSMimeHdrFieldDestroy(bufp, hdr_loc, field_loc);
   }
-  tmp = TSMimeHdrFieldNextDup(bufp, hdr_loc, field_loc);
   TSHandleMLocRelease(bufp, hdr_loc, field_loc);
   field_loc = tmp;
 }
diff --git a/plugins/cache_range_requests/cache_range_requests.cc 
b/plugins/cache_range_requests/cache_range_requests.cc
index cf2e04f..5b43d45 100644
--- a/plugins/cache_range_requests/cache_range_requests.cc
+++ b/plugins/cache_range_requests/cache_range_requests.cc
@@ -433,6 +433,7 @@ set_header(TSMBuffer buf, TSMLoc hdr_loc, const char 
*header, int len, const cha
 bool first = true;
 
 while (field_loc) {
+  tmp = TSMimeHdrFieldNextDup(buf, hdr_loc, field_loc);
   if (first) {
 first = false;
 if (TS_SUCCESS == TSMimeHdrFieldValueStringSet(buf, hdr_loc, 
field_loc, -1, val, val_len)) {
@@ -441,7 +442,6 @@ set_header(TSMBuffer buf, TSMLoc hdr_loc, const char 
*header, int len, const cha
   } else {
 TSMimeHdrFieldDestroy(buf, hdr_loc, field_loc);
   }
-  tmp = TSMimeHdrFieldNextDup(buf, hdr_loc, field_loc);
   TSHandleMLocRelease(buf, hdr_loc, field_loc);
   field_loc = tmp;
 }
diff --git a/plugins/experimental/access_control/headers.cc 
b/plugins/experimental/access_control/headers.cc
index a22e0ff..1d5089b 100644
--- a/plugins/experimental/access_control/headers.cc
+++ b/plugins/experimental/access_control/headers.cc
@@ -156,6 +156,7 @@ setHeader(TSMBuffer bufp, TSMLoc hdrLoc, const char 
*header, int headerlen, cons
 bool first = true;
 
 while (fieldLoc) {
+  tmp = TSMimeHdrFieldNextDup(bufp, hdrLoc, fieldLoc);
   if (first) {
 first = false;
 if (TS_SUCCESS == TSMimeHdrFieldValueStringSet(bufp, hdrLoc, fieldLoc, 
-1, value, valuelen)) {
@@ -164,7 +165,6 @@ setHeader(TSMBuffer bufp, TSMLoc hdrLoc, const char 
*header, int headerlen, cons
   } else {
 TSMimeHdrFieldDestroy(bufp, hdrLoc, fieldLoc);
   }
-  tmp = TSMimeHdrFieldNextDup(bufp, hdrLoc, fieldLoc);
   TSHandleMLocRelease(bufp, hdrLoc, fieldLoc);
   fieldLoc = tmp;
 }
diff --git a/plugins/experimental/cache_fill/background_fetch.cc 
b/plugins/experimental/cache_fill/background_fetch.cc
index 99857e8..ba74907 100644
--- a/plugins/experimental/cache_fill/background_fetch.cc
+++ b/plugins/experimental/cache_fill/background_fetch.cc
@@ -68,6 +68,7 @@ set_header(TSMBuffer bufp, TSMLoc hdr_loc, const char 
*header, int len, const ch
 bool first = true;
 
 while (field_loc) {
+  tmp = TSMimeHdrFieldNextDup(bufp, hdr_loc, field_loc);
   if (first) {
 first = false;
 if (TS_SUCCESS == TSMimeHdrFieldValueStringSet(bufp, hdr_loc, 
field_loc, -1, val, val_len)) {
@@ -76,7 +77,6 @@ set_header(TSMBuffer bufp, TSMLoc hdr_loc, const char 
*header, int len, const ch
   } else {
 TSMimeHdrFieldDestroy(bufp, hdr_loc, field_loc);
   }
-  tmp = TSMimeHdrFieldNextDup(bufp, hdr_loc, field_loc);