|
From: <cn...@us...> - 2020-04-25 17:10:40
|
Revision: 1025
http://sourceforge.net/p/seq/svn/1025
Author: cn187
Date: 2020-04-25 17:10:38 +0000 (Sat, 25 Apr 2020)
Log Message:
-----------
Fix packet decode delay with libpcap >= 1.9.1
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/packetcapture.cpp
Modified: showeq/branches/pre_6_0_beta/src/packetcapture.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetcapture.cpp 2020-04-16 08:31:05 UTC (rev 1024)
+++ showeq/branches/pre_6_0_beta/src/packetcapture.cpp 2020-04-25 17:10:38 UTC (rev 1025)
@@ -149,8 +149,12 @@
** Not all platforms support a read timeout; on platforms that
** don't, the read timeout is ignored.
**
- ** In Linux 2.4.x with the to_ms set to 0 we get packets immediatly,
- ** and thats what we need in this application, so don't change it!!
+ ** In Linux 2.4.x with the to_ms set to 0 we got packets immediatly,
+ ** and thats what we need in this application. However, as of libpcap
+ ** 1.9.1, a timeout of 0 means infinity, so that no longer works. A
+ ** negative timeout will use the default kernal timeout, which can
+ ** vary. So the most prudent option is to set the timeout as low
+ ** as we can, to 1 ms.
**
** a race condition exists between this thread and the main thread
** any artificial delay in getting packets can cause filtering problems
@@ -157,7 +161,7 @@
** and cause us to miss new stream when the player zones.
*/
// initialize the pcap object
- m_pcache_pcap = pcap_open_live((char *) device, BUFSIZ, true, 0, ebuf);
+ m_pcache_pcap = pcap_open_live((char *) device, BUFSIZ, true, 1, ebuf);
#ifdef __FreeBSD__
// if we're on FreeBSD, we need to call ioctl on the file descriptor
// with BIOCIMMEDIATE to get the kernel Berkeley Packet Filter device
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|