[trafficserver] branch master updated: LGTM: Remove superfluous const qualifier in return type (#7412)

2021-01-11 Thread masaori
This is an automated email from the ASF dual-hosted git repository.

masaori 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 09dadf5  LGTM: Remove superfluous const qualifier in return type 
(#7412)
09dadf5 is described below

commit 09dadf50a70681dcc2fd1b599d6ba2bb91e8c36f
Author: Masaori Koshiba 
AuthorDate: Tue Jan 12 08:01:55 2021 +0900

LGTM: Remove superfluous const qualifier in return type (#7412)
---
 include/tscore/AtomicBit.h  | 2 +-
 include/tscore/Extendible.h | 4 ++--
 iocore/net/quic/QUICTypes.cc| 2 +-
 iocore/net/quic/QUICTypes.h | 2 +-
 plugins/experimental/ssl_session_reuse/src/connection.h | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/tscore/AtomicBit.h b/include/tscore/AtomicBit.h
index 72581d3..5744d77 100644
--- a/include/tscore/AtomicBit.h
+++ b/include/tscore/AtomicBit.h
@@ -64,7 +64,7 @@ public:
   }
 
   // allow cast to bool
-  explicit operator const bool() const { return (*_byte_ptr) & _mask; }
+  explicit operator bool() const { return (*_byte_ptr) & _mask; }
 
   // allows compare with bool
   bool
diff --git a/include/tscore/Extendible.h b/include/tscore/Extendible.h
index 2ac826f..ea94a74 100644
--- a/include/tscore/Extendible.h
+++ b/include/tscore/Extendible.h
@@ -359,7 +359,7 @@ namespace details
   /// Bool specializations
 
   template 
-  const bool
+  bool
   fieldGet(const void *fld_ptr, FieldId const )
   {
 return bool((*static_cast(fld_ptr)) & field.desc->mask);
@@ -395,7 +395,7 @@ namespace details
   /// std::atomic specializations (same as bool)
 
   template 
-  inline const bool
+  inline bool
   fieldGet(void const *fld_ptr, FieldId> const 
)
   {
 return bool(fld_ptr & field.mask);
diff --git a/iocore/net/quic/QUICTypes.cc b/iocore/net/quic/QUICTypes.cc
index 305abc2..3b7d586 100644
--- a/iocore/net/quic/QUICTypes.cc
+++ b/iocore/net/quic/QUICTypes.cc
@@ -355,7 +355,7 @@ QUICResumptionToken::cid() const
   return QUICTypeUtil::read_QUICConnectionId(this->_token + (1 + 20 + 4), 
this->_token_len - (1 + 20 + 4));
 }
 
-const ink_hrtime
+ink_hrtime
 QUICResumptionToken::expire_time() const
 {
   return QUICIntUtil::read_nbytes_as_uint(this->_token + (1 + 20), 4);
diff --git a/iocore/net/quic/QUICTypes.h b/iocore/net/quic/QUICTypes.h
index 021ccea..50e8752 100644
--- a/iocore/net/quic/QUICTypes.h
+++ b/iocore/net/quic/QUICTypes.h
@@ -373,7 +373,7 @@ public:
   bool is_valid(const IpEndpoint ) const;
 
   const QUICConnectionId cid() const;
-  const ink_hrtime expire_time() const;
+  ink_hrtime expire_time() const;
 };
 
 class QUICRetryToken : public QUICAddressValidationToken
diff --git a/plugins/experimental/ssl_session_reuse/src/connection.h 
b/plugins/experimental/ssl_session_reuse/src/connection.h
index eb99c50..597f496 100644
--- a/plugins/experimental/ssl_session_reuse/src/connection.h
+++ b/plugins/experimental/ssl_session_reuse/src/connection.h
@@ -55,7 +55,7 @@ public:
* management.
* @return
*/
-  inline redisContext *const
+  inline redisContext *
   c_ptr() const
   {
 return c;



[trafficserver] branch master updated: Fix issue with unavailable server retry codes (#7410)

2021-01-11 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 98ec28e  Fix issue with unavailable server retry codes (#7410)
98ec28e is described below

commit 98ec28e64cb93cb40e6cd845da3022bdd68d6148
Author: Evan Zelkowitz 
AuthorDate: Mon Jan 11 10:23:10 2021 -0700

Fix issue with unavailable server retry codes (#7410)

Currently when populating the list it checks for >500, this should be 499 
to not exclude `500`

Also adding warnings during token parsing to notify if a user has added an 
erroneous err code to the unavailable or simple codes list
---
 proxy/ParentSelection.cc | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index 08254a4..61706b0 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -332,15 +332,17 @@ 
UnavailableServerResponseCodes::UnavailableServerResponseCodes(char *val)
   numTok = pTok.Initialize(val, SHARE_TOKS);
   if (numTok == 0) {
 c = atoi(val);
-if (c > 500 && c < 600) {
+if (c > 499 && c < 600) {
   codes.push_back(HTTP_STATUS_SERVICE_UNAVAILABLE);
 }
   }
   for (int i = 0; i < numTok; i++) {
 c = atoi(pTok[i]);
-if (c > 500 && c < 600) {
+if (c > 499 && c < 600) {
   Debug("parent_select", "loading response code: %d", c);
   codes.push_back(c);
+} else {
+  Warning("UnavailableServerResponseCodes received non-5xx code '%s', 
ignoring!", pTok[i]);
 }
   }
   std::sort(codes.begin(), codes.end());
@@ -368,6 +370,8 @@ SimpleRetryResponseCodes::SimpleRetryResponseCodes(char 
*val)
 if (c > 399 && c < 500) {
   Debug("parent_select", "loading simple response code: %d", c);
   codes.push_back(c);
+} else {
+  Warning("SimpleRetryResponseCodes received non-4xx code '%s', 
ignoring!", pTok[i]);
 }
   }
   std::sort(codes.begin(), codes.end());