Skip to content

Commit

Permalink
Fix issues in IpfixDecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
BonnyAD9 committed Jun 13, 2024
1 parent ab7f0fb commit 8ee14f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/plugins/input/tcp/src/IpfixDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

namespace tcp_in {

using namespace std;

DecodeBuffer &IpfixDecoder::decode() {
while (!m_decoded.enough_data()) {
if (!read_header()) {
Expand All @@ -38,7 +36,7 @@ DecodeBuffer &IpfixDecoder::decode() {
}

if (m_decoded.is_eof_reached() && m_part_readed.size() != 0) {
throw runtime_error("Received incomplete message.");
throw std::runtime_error("Received incomplete message.");
}

return m_decoded;
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/input/tcp/src/IpfixDecoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace tcp_in {

/** Identifies data for which this decoder should be used. */
constexpr uint16_t IPFIX_MAGIC = 10;

/** Decoder for basic IPFX data. */
Expand Down Expand Up @@ -48,6 +49,7 @@ class IpfixDecoder : public Decoder {
DecodeBuffer m_decoded;

ByteVector m_part_readed;
/** Final size of the whole IPFIX message. When 0 IPIFX header is not fully read. */
size_t m_msg_size;
};

Expand Down

0 comments on commit 8ee14f1

Please sign in to comment.