diff options
Diffstat (limited to 'src/core/parser/stack/Stack.cpp')
-rw-r--r-- | src/core/parser/stack/Stack.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/parser/stack/Stack.cpp b/src/core/parser/stack/Stack.cpp index c67f43c..ef503f7 100644 --- a/src/core/parser/stack/Stack.cpp +++ b/src/core/parser/stack/Stack.cpp @@ -117,6 +117,11 @@ public: bool hadDefaultField : 1; /** + * Set to true once data was passed to the handler. + */ + bool hadData : 1; + + /** * Set to false, if the handler is not greedy (true is the default value). * If false, the handler will only be passed one piece of "data" at most. */ @@ -194,6 +199,7 @@ HandlerInfo::HandlerInfo(std::shared_ptr<Handler> handler) inImplicitDefaultField(false), inValidField(false), hadDefaultField(false), + hadData(false), greedy(true) { } @@ -211,6 +217,7 @@ HandlerInfo::HandlerInfo(bool implicit, bool inField, bool inDefaultField, inImplicitDefaultField(inImplicitDefaultField), inValidField(true), hadDefaultField(false), + hadData(false), greedy(true) { } @@ -880,6 +887,9 @@ bool StackImpl::handleData() loggerFork.log(ex); } + // Update the "hadData" flag + info.hadData = info.hadData || valid; + // Reset the logger instance of the handler as soon as possible info.handler->resetLogger(); |