summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-08-03 14:01:06 +0300
committerimarom <imarom@cisco.com>2016-08-03 15:03:09 +0300
commit5bbf8a6df83708bd23226139d0e641b835e87e88 (patch)
tree567a1f1336fb07611bdfd0f3e001442c2a1584c6
parent35ab1e1766baedee576d282c928ac37b42f66e8d (diff)
push_remote with all packet times zero sends only one packet
fix for #trex-235
-rwxr-xr-xsrc/common/pcap.cpp6
-rw-r--r--src/publisher/trex_publisher.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/common/pcap.cpp b/src/common/pcap.cpp
index a68fb620..8e9bf0ac 100755
--- a/src/common/pcap.cpp
+++ b/src/common/pcap.cpp
@@ -154,18 +154,18 @@ bool LibPCapReader::ReadPacket(CCapPktRaw *lpPacket)
if (m_is_flip) {
flip(&pkt_header);
}
- if (pkt_header.len > READER_MAX_PACKET_SIZE) {
+ if (pkt_header.caplen > READER_MAX_PACKET_SIZE) {
/* cannot read this packet */
//printf("ERROR packet is too big, bigger than %d \n",READER_MAX_PACKET_SIZE);
return false;
}
- lpPacket->pkt_len = fread(lpPacket->raw,1,pkt_header.len,m_file_handler);
+ lpPacket->pkt_len = fread(lpPacket->raw,1,pkt_header.caplen,m_file_handler);
lpPacket->time_sec = pkt_header.ts.sec;
lpPacket->time_nsec = pkt_header.ts.msec*1000;
- if ( lpPacket->pkt_len < pkt_header.len) {
+ if ( lpPacket->pkt_len < pkt_header.caplen) {
lpPacket->pkt_len = 0;
return false;
}
diff --git a/src/publisher/trex_publisher.cpp b/src/publisher/trex_publisher.cpp
index 850b5955..67670593 100644
--- a/src/publisher/trex_publisher.cpp
+++ b/src/publisher/trex_publisher.cpp
@@ -77,7 +77,7 @@ void
TrexPublisher::publish_json(const std::string &s, uint32_t zip_threshold){
if (m_publisher) {
- if ( (zip_threshold > 0) && (s.size() > zip_threshold) ) {
+ if ( (zip_threshold != 0) && (s.size() > zip_threshold) ) {
publish_zipped_json(s);
} else {
publish_raw_json(s);