face: send Nack after every InterestCallback has responded
refs #4228
Change-Id: I3b1ef58c70d34c2099249216a3600efe01b79f71
diff --git a/src/lp/nack-header.cpp b/src/lp/nack-header.cpp
index 3bbc985..f289c86 100644
--- a/src/lp/nack-header.cpp
+++ b/src/lp/nack-header.cpp
@@ -46,6 +46,19 @@
return os;
}
+bool
+isLessSevere(lp::NackReason x, lp::NackReason y)
+{
+ if (x == lp::NackReason::NONE) {
+ return false;
+ }
+ if (y == lp::NackReason::NONE) {
+ return true;
+ }
+
+ return static_cast<int>(x) < static_cast<int>(y);
+}
+
NackHeader::NackHeader()
: m_reason(NackReason::NONE)
{
diff --git a/src/lp/nack-header.hpp b/src/lp/nack-header.hpp
index 0c034f4..e4b8c14 100644
--- a/src/lp/nack-header.hpp
+++ b/src/lp/nack-header.hpp
@@ -46,6 +46,13 @@
std::ostream&
operator<<(std::ostream& os, NackReason reason);
+/** \brief compare NackReason for severity
+ *
+ * lp::NackReason::NONE is treated as most severe
+ */
+bool
+isLessSevere(lp::NackReason x, lp::NackReason y);
+
/**
* \brief represents a Network NACK header
*/