From 92bfba79b009bc1278edc1d4685d05c2f9fcb581 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Tue, 27 Jan 2009 19:40:46 +0000 Subject: Now logging pcap error message even if success. It seems there might be some useful info in there in some cases. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@601 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp') diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index ce1a230..d50a039 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -3046,6 +3046,10 @@ pcap_t* VoIp::OpenDevice(CStdString& name) if(m_pcapHandle) { error = ApplyPcapFilter(); + if(error == NULL) + { + error = errorBuf; + } } if(m_pcapHandle == NULL) { @@ -3053,7 +3057,7 @@ pcap_t* VoIp::OpenDevice(CStdString& name) } else { - logMsg.Format("Successfully opened device. pcap handle:%x", m_pcapHandle); + logMsg.Format("Successfully opened device. pcap handle:%x message:%s", m_pcapHandle, error); LOG4CXX_INFO(s_packetLog, logMsg); SetPcapSocketBufferSize(m_pcapHandle); } @@ -3113,6 +3117,10 @@ void VoIp::OpenDevices() if(m_pcapHandle) { error = ApplyPcapFilter(); + if(error == NULL) + { + error = errorBuf; + } } if(m_pcapHandle == NULL) { @@ -3123,7 +3131,7 @@ void VoIp::OpenDevices() CStdString logMsg, deviceName; deviceName = device->name; - logMsg.Format("Successfully opened device. pcap handle:%x", m_pcapHandle); + logMsg.Format("Successfully opened device. pcap handle:%x message:%s", m_pcapHandle, error); LOG4CXX_INFO(s_packetLog, logMsg); SetPcapSocketBufferSize(m_pcapHandle); @@ -3147,6 +3155,10 @@ void VoIp::OpenDevices() if(m_pcapHandle) { error = ApplyPcapFilter(); + if(error == NULL) + { + error = errorBuf; + } } if(m_pcapHandle == NULL) { @@ -3157,7 +3169,7 @@ void VoIp::OpenDevices() { CStdString deviceName; - logMsg.Format("Successfully opened default device:%s pcap handle:%x", defaultDevice->name, m_pcapHandle); + logMsg.Format("Successfully opened default device:%s pcap handle:%x message:%s", defaultDevice->name, m_pcapHandle, error); LOG4CXX_INFO(s_packetLog, logMsg); SetPcapSocketBufferSize(m_pcapHandle); -- cgit v1.2.3