opalvoip-svn Mailing List for OpalVOIP (Page 4)
Brought to you by:
csoutheren,
rjongbloed
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(71) |
Nov
(241) |
Dec
(143) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(210) |
Feb
(263) |
Mar
(214) |
Apr
(290) |
May
(203) |
Jun
(160) |
Jul
(128) |
Aug
(158) |
Sep
(376) |
Oct
(234) |
Nov
(227) |
Dec
(216) |
2009 |
Jan
(99) |
Feb
(151) |
Mar
(234) |
Apr
(143) |
May
(271) |
Jun
(244) |
Jul
(173) |
Aug
(124) |
Sep
(246) |
Oct
(178) |
Nov
(85) |
Dec
(77) |
2010 |
Jan
(101) |
Feb
(79) |
Mar
(92) |
Apr
(134) |
May
(125) |
Jun
(121) |
Jul
(61) |
Aug
(70) |
Sep
(86) |
Oct
(81) |
Nov
(65) |
Dec
(75) |
2011 |
Jan
(110) |
Feb
(119) |
Mar
(267) |
Apr
(154) |
May
(296) |
Jun
(177) |
Jul
(149) |
Aug
(124) |
Sep
(120) |
Oct
(116) |
Nov
(99) |
Dec
(121) |
2012 |
Jan
(78) |
Feb
(161) |
Mar
(323) |
Apr
(154) |
May
(190) |
Jun
(207) |
Jul
(176) |
Aug
(165) |
Sep
(137) |
Oct
(85) |
Nov
(112) |
Dec
(100) |
2013 |
Jan
(341) |
Feb
(102) |
Mar
(240) |
Apr
(216) |
May
(233) |
Jun
(226) |
Jul
(139) |
Aug
(192) |
Sep
(183) |
Oct
(211) |
Nov
(220) |
Dec
(110) |
2014 |
Jan
(203) |
Feb
(205) |
Mar
(100) |
Apr
(178) |
May
(194) |
Jun
(249) |
Jul
(136) |
Aug
(241) |
Sep
(226) |
Oct
(200) |
Nov
(94) |
Dec
(46) |
2015 |
Jan
(94) |
Feb
(74) |
Mar
(89) |
Apr
(78) |
May
(65) |
Jun
(70) |
Jul
(113) |
Aug
(176) |
Sep
(140) |
Oct
(154) |
Nov
(99) |
Dec
(115) |
2016 |
Jan
(102) |
Feb
(69) |
Mar
(97) |
Apr
(53) |
May
(42) |
Jun
(13) |
Jul
(42) |
Aug
(30) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <rjo...@us...> - 2016-06-23 10:17:20
|
Revision: 34851 http://sourceforge.net/p/opalvoip/code/34851 Author: rjongbloed Date: 2016-06-23 10:17:17 +0000 (Thu, 23 Jun 2016) Log Message: ----------- Fixed regression with a retry of a re-INVITE being interpreted as an initial INVITE. Caused by recent workaround for Asterisk using initial INVITE transaction ID on re-INVITE transaction. Modified Paths: -------------- opal/trunk/src/sip/sipcon.cxx Modified: opal/trunk/src/sip/sipcon.cxx =================================================================== --- opal/trunk/src/sip/sipcon.cxx 2016-06-22 08:24:25 UTC (rev 34850) +++ opal/trunk/src/sip/sipcon.cxx 2016-06-23 10:17:17 UTC (rev 34851) @@ -2175,9 +2175,8 @@ void SIPConnection::OnReceivedINVITE(SIP_PDU & request) { - bool isReinvite = IsOriginating() || - (m_lastReceivedINVITE != NULL && m_lastReceivedINVITE->GetTransactionID() != request.GetTransactionID()); - PTRACE_IF(4, !isReinvite, "Initial INVITE to " << request.GetURI()); + bool isReinvite = IsOriginating() || GetPhase() >= ConnectedPhase; + PTRACE(3, (isReinvite ? "Re-" : "Initial ") << "INVITE to " << request.GetURI() << ", id=" << request.GetTransactionID()); // m_lastReceivedINVITE should contain the last received INVITE for this connection delete m_lastReceivedINVITE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-22 08:24:28
|
Revision: 34850 http://sourceforge.net/p/opalvoip/code/34850 Author: rjongbloed Date: 2016-06-22 08:24:25 +0000 (Wed, 22 Jun 2016) Log Message: ----------- Merged revision(s) 34840-34849 from opal/branches/v3_16: --------------------- r34848 Added last packet received time to final media statistics trace log. --------------------- r34847 Fixed compiler warning when video disabled. --------------------- r34846 Prevent mouse movement of video window in OpalSharp sample Revision Links: -------------- http://sourceforge.net/p/opalvoip/code/34848 http://sourceforge.net/p/opalvoip/code/34847 http://sourceforge.net/p/opalvoip/code/34846 Modified Paths: -------------- opal/trunk/samples/OpalSharp/Form1.cs opal/trunk/src/ep/localep.cxx opal/trunk/src/rtp/rtp_session.cxx Property Changed: ---------------- opal/trunk/ Index: opal/trunk =================================================================== --- opal/trunk 2016-06-22 08:21:42 UTC (rev 34849) +++ opal/trunk 2016-06-22 08:24:25 UTC (rev 34850) Property changes on: opal/trunk ___________________________________________________________________ Modified: svn:mergeinfo ## -10,7 +10,7 ## /opal/branches/v3_10:25182-29485,30896,32927-32928,32933 /opal/branches/v3_12:28489-31709 /opal/branches/v3_14:31505-33613 -/opal/branches/v3_16:34090-34839 +/opal/branches/v3_16:34090-34849 /opal/branches/v3_2:21143,21220,21227,21253,21455 /opal/branches/v3_4:21060,21062,21088,21092,21111,21113,21115,21119,21143,21148,21151-21152,21155,21158,21184,21188,21253,21265-21266,21283-21284,21298,21300,21303,21307,21309,21311,21327,21331,21333,21359,21367,21369,21488,21556,21564-21565,21568,21570,21620,21625,21631,21748,21751,21756,21759,21761,21767,21770,22246,23044,23140,23143,23286 /opal/branches/v3_6:22169,22178,22184,22186,22197,22204,22216,22251,22253,22255,22258,22260,22291,22296,22300,22306,22308,22313,22319,22336,22353,22358,22436,22447,22449,22497,22511,22517,22519-22521,22527,22536,22538,22589,22596,22599,22617,22620,22622,22630,22640,22655,22675,22682,22726-22728,22730,22733,22738,22745-22746,22800,22820-22821,22842,22844-22845,22851,22853,22889,22896,22902,22904,22906,22918,22924,22928,22946,22965,22967,22976,22978,22980,22982,22994,23028,23123,23125-23126,23128,23157,23165,23173,23175,23183,23294,23341,23465,23467,23474,23521,23829,24346,24809 \ No newline at end of property Modified: opal/trunk/samples/OpalSharp/Form1.cs =================================================================== --- opal/trunk/samples/OpalSharp/Form1.cs 2016-06-22 08:21:42 UTC (rev 34849) +++ opal/trunk/samples/OpalSharp/Form1.cs 2016-06-22 08:24:25 UTC (rev 34850) @@ -141,8 +141,8 @@ gen.mediaOptions = "video:Frame Width=640\nvideo:Frame Height=480\nvideo:Target Bit Rate=256000"; gen.audioPlayerDevice = "Default communications"; gen.audioRecordDevice = "Default communications"; - gen.videoOutputDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoDisplay.Handle + " X=0 Y=0 WIDTH=" + VideoDisplay.Width + " HEIGHT=" + VideoDisplay.Height; - gen.videoPreviewDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoPreview.Handle + " X=0 Y=0 WIDTH=" + VideoPreview.Width + " HEIGHT=" + VideoPreview.Height; + gen.videoOutputDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoDisplay.Handle + " X=0 Y=0 WIDTH=" + VideoDisplay.Width + " HEIGHT=" + VideoDisplay.Height + " NO-MOUSE"; + gen.videoPreviewDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoPreview.Handle + " X=0 Y=0 WIDTH=" + VideoPreview.Width + " HEIGHT=" + VideoPreview.Height + " NO-MOUSE"; gen.noMediaTimeout = 15000; OpalMessagePtr result = new OpalMessagePtr(); if (!m_opalContext.SendMessage(msg, result)) Modified: opal/trunk/src/ep/localep.cxx =================================================================== --- opal/trunk/src/ep/localep.cxx 2016-06-22 08:21:42 UTC (rev 34849) +++ opal/trunk/src/ep/localep.cxx 2016-06-22 08:24:25 UTC (rev 34850) @@ -251,8 +251,11 @@ OpalLocalEndPoint::Synchronicity - OpalLocalEndPoint::GetSynchronicity(const OpalMediaFormat & mediaFormat, - bool isSource) const + OpalLocalEndPoint::GetSynchronicity(const OpalMediaFormat & mediaFormat, bool +#if OPAL_VIDEO + isSource +#endif + ) const { if (mediaFormat.GetMediaType() == OpalMediaType::Audio()) return m_defaultAudioSynchronicity; Modified: opal/trunk/src/rtp/rtp_session.cxx =================================================================== --- opal/trunk/src/rtp/rtp_session.cxx 2016-06-22 08:21:42 UTC (rev 34849) +++ opal/trunk/src/rtp/rtp_session.cxx 2016-06-22 08:24:25 UTC (rev 34850) @@ -365,6 +365,7 @@ << m_direction << " statistics:\n" " Sync Source ID = " << RTP_TRACE_SRC(m_sourceIdentifier) << "\n" " first packet = " << m_firstPacketTime << "\n" + " last packet = " << m_lastPacketTimestamp << "\n" " total packets = " << m_packets << "\n" " total octets = " << m_octets << "\n" " bitRateSent = " << (8 * m_octets / duration) << "\n" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-22 08:21:44
|
Revision: 34849 http://sourceforge.net/p/opalvoip/code/34849 Author: rjongbloed Date: 2016-06-22 08:21:42 +0000 (Wed, 22 Jun 2016) Log Message: ----------- Fixed build with video disabled Modified Paths: -------------- opal/trunk/src/rtp/srtp_session.cxx Modified: opal/trunk/src/rtp/srtp_session.cxx =================================================================== --- opal/trunk/src/rtp/srtp_session.cxx 2016-06-22 08:11:50 UTC (rev 34848) +++ opal/trunk/src/rtp/srtp_session.cxx 2016-06-22 08:21:42 UTC (rev 34849) @@ -787,10 +787,12 @@ random number for audio, neither of which they indicate in the SDP when in recvonly mode. So, we try and compensate. */ if (m_anyRTCP_SSRC) { +#if OPAL_VIDEO if ((ssrc == 1) != (GetMediaType() == OpalMediaType::Video())) { PTRACE(4, *this << "not automatically adding SSRC=" << RTP_TRACE_SRC(ssrc) << " for " << GetMediaType()); return e_IgnorePacket; } +#endif m_anyRTCP_SSRC = false; force = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-22 08:11:56
|
Revision: 34848 http://sourceforge.net/p/opalvoip/code/34848 Author: rjongbloed Date: 2016-06-22 08:11:50 +0000 (Wed, 22 Jun 2016) Log Message: ----------- Added last packet received time to final media statistics trace log. Modified Paths: -------------- opal/branches/v3_16/src/rtp/rtp_session.cxx Modified: opal/branches/v3_16/src/rtp/rtp_session.cxx =================================================================== --- opal/branches/v3_16/src/rtp/rtp_session.cxx 2016-06-22 08:10:54 UTC (rev 34847) +++ opal/branches/v3_16/src/rtp/rtp_session.cxx 2016-06-22 08:11:50 UTC (rev 34848) @@ -364,6 +364,7 @@ << m_direction << " statistics:\n" " Sync Source ID = " << RTP_TRACE_SRC(m_sourceIdentifier) << "\n" " first packet = " << m_firstPacketTime << "\n" + " last packet = " << m_lastPacketTimestamp << "\n" " total packets = " << m_packets << "\n" " total octets = " << m_octets << "\n" " bitRateSent = " << (8 * m_octets / duration) << "\n" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-22 08:10:57
|
Revision: 34847 http://sourceforge.net/p/opalvoip/code/34847 Author: rjongbloed Date: 2016-06-22 08:10:54 +0000 (Wed, 22 Jun 2016) Log Message: ----------- Fixed compiler warning when video disabled. Modified Paths: -------------- opal/branches/v3_16/src/ep/localep.cxx Modified: opal/branches/v3_16/src/ep/localep.cxx =================================================================== --- opal/branches/v3_16/src/ep/localep.cxx 2016-06-22 07:59:52 UTC (rev 34846) +++ opal/branches/v3_16/src/ep/localep.cxx 2016-06-22 08:10:54 UTC (rev 34847) @@ -251,8 +251,11 @@ OpalLocalEndPoint::Synchronicity - OpalLocalEndPoint::GetSynchronicity(const OpalMediaFormat & mediaFormat, - bool isSource) const + OpalLocalEndPoint::GetSynchronicity(const OpalMediaFormat & mediaFormat, bool +#if OPAL_VIDEO + isSource +#endif + ) const { if (mediaFormat.GetMediaType() == OpalMediaType::Audio()) return m_defaultAudioSynchronicity; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-22 07:59:56
|
Revision: 34846 http://sourceforge.net/p/opalvoip/code/34846 Author: rjongbloed Date: 2016-06-22 07:59:52 +0000 (Wed, 22 Jun 2016) Log Message: ----------- Prevent mouse movement of video window in OpalSharp sample Modified Paths: -------------- opal/branches/v3_16/samples/OpalSharp/Form1.cs Modified: opal/branches/v3_16/samples/OpalSharp/Form1.cs =================================================================== --- opal/branches/v3_16/samples/OpalSharp/Form1.cs 2016-06-14 12:14:41 UTC (rev 34845) +++ opal/branches/v3_16/samples/OpalSharp/Form1.cs 2016-06-22 07:59:52 UTC (rev 34846) @@ -141,8 +141,8 @@ gen.mediaOptions = "video:Frame Width=640\nvideo:Frame Height=480\nvideo:Target Bit Rate=256000"; gen.audioPlayerDevice = "Default communications"; gen.audioRecordDevice = "Default communications"; - gen.videoOutputDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoDisplay.Handle + " X=0 Y=0 WIDTH=" + VideoDisplay.Width + " HEIGHT=" + VideoDisplay.Height; - gen.videoPreviewDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoPreview.Handle + " X=0 Y=0 WIDTH=" + VideoPreview.Width + " HEIGHT=" + VideoPreview.Height; + gen.videoOutputDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoDisplay.Handle + " X=0 Y=0 WIDTH=" + VideoDisplay.Width + " HEIGHT=" + VideoDisplay.Height + " NO-MOUSE"; + gen.videoPreviewDevice = "MSWIN STYLE=0x50000000 PARENT=" + VideoPreview.Handle + " X=0 Y=0 WIDTH=" + VideoPreview.Width + " HEIGHT=" + VideoPreview.Height + " NO-MOUSE"; gen.noMediaTimeout = 15000; OpalMessagePtr result = new OpalMessagePtr(); if (!m_opalContext.SendMessage(msg, result)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-14 12:14:43
|
Revision: 34845 http://sourceforge.net/p/opalvoip/code/34845 Author: rjongbloed Date: 2016-06-14 12:14:41 +0000 (Tue, 14 Jun 2016) Log Message: ----------- Allow for retransmit of re-INVITE. This also deals with a strange bug in Asterisk, where it appears to try to do a re-INVITE using the same transaction ID as the initial INVITE it sent. Modified Paths: -------------- opal/trunk/src/sip/sipcon.cxx Modified: opal/trunk/src/sip/sipcon.cxx =================================================================== --- opal/trunk/src/sip/sipcon.cxx 2016-06-13 11:08:45 UTC (rev 34844) +++ opal/trunk/src/sip/sipcon.cxx 2016-06-14 12:14:41 UTC (rev 34845) @@ -2115,6 +2115,14 @@ SIPConnection::TypeOfINVITE SIPConnection::CheckINVITE(const SIP_PDU & request) const { + /* If we have same transaction ID, it means it is a retransmission + of the original INVITE, probably should re-transmit last sent response + but we just ignore it. Still should work. */ + if (m_lastReceivedINVITE != NULL && m_lastReceivedINVITE->GetTransactionID() == request.GetTransactionID()) { + PTRACE(3, "Ignoring duplicate INVITE from " << request.GetURI() << " after " << m_phaseTime[UninitialisedPhase].GetElapsed()); + return IsDuplicateINVITE; + } + const SIPMIMEInfo & requestMIME = request.GetMIME(); PString requestFromTag = requestMIME.GetFieldParameter("From", "tag"); PString requestToTag = requestMIME.GetFieldParameter("To", "tag"); @@ -2129,7 +2137,7 @@ if (IsOriginating()) { /* Weird, got incoming INVITE for a call we originated, however it is not in the same dialog. Send back a refusal as this just isn't handled. */ - PTRACE(2, "Ignoring INVITE from " << request.GetURI() << " when originated call."); + PTRACE(2, "Ignoring INVITE from " << request.GetURI() << " when we originated call."); return IsLoopedINVITE; } @@ -2138,21 +2146,13 @@ // to be new INVITE, then it should be retried and next time the race // will be passed. if (m_lastReceivedINVITE == NULL) { - PTRACE(3, "Ignoring INVITE from " << request.GetURI() << " as we are originator."); + PTRACE(3, "Ignoring INVITE from " << request.GetURI() << " as have not yet processed pevious one."); return IsDuplicateINVITE; } - /* If we have same transaction ID, it means it is a retransmission - of the original INVITE, probably should re-transmit last sent response - but we just ignore it. Still should work. */ - if (m_lastReceivedINVITE->GetTransactionID() == request.GetTransactionID()) { - PTRACE(3, "Ignoring duplicate INVITE from " << request.GetURI() << " after " << (PTime() - m_phaseTime[SetUpPhase])); - return IsDuplicateINVITE; - } - // Check if is RFC3261/8.2.2.2 case relating to merged requests. if (!requestToTag.IsEmpty()) { - PTRACE(3, "Ignoring INVITE from " << request.GetURI() << " as has invalid to-tag."); + PTRACE(2, "Ignoring INVITE from " << request.GetURI() << " as has invalid to-tag \"" << requestToTag << '"'); return IsDuplicateINVITE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-13 11:08:47
|
Revision: 34844 http://sourceforge.net/p/opalvoip/code/34844 Author: rjongbloed Date: 2016-06-13 11:08:45 +0000 (Mon, 13 Jun 2016) Log Message: ----------- Trace log improvement around RTP out of order resequencing. Modified Paths: -------------- opal/trunk/src/rtp/rtp_session.cxx Modified: opal/trunk/src/rtp/rtp_session.cxx =================================================================== --- opal/trunk/src/rtp/rtp_session.cxx 2016-06-13 10:41:08 UTC (rev 34843) +++ opal/trunk/src/rtp/rtp_session.cxx 2016-06-13 11:08:45 UTC (rev 34844) @@ -565,7 +565,6 @@ m_consecutiveOutOfOrderPackets = 0; } else if (sequenceDelta > SequenceReorderThreshold) { - PTRACE(3, &m_session, *this << "late out of order packet, got " << sequenceNumber << " expected " << expectedSequenceNumber); ++m_lateOutOfOrder; if (m_packetsLost > 0) --m_packetsLost; // Previously marked as lost @@ -575,9 +574,14 @@ if (running && ++m_lateOutOfOrderAdaptCount >= m_lateOutOfOrderAdaptMax) { PTimeInterval timeout = m_session.GetOutOfOrderWaitTime() + m_lateOutOfOrderAdaptBoost; m_session.SetOutOfOrderWaitTime(timeout); - PTRACE(2, &m_session, *this << " increased out of order packet timeout to " << timeout); + PTRACE(2, &m_session, *this << "late out of order packet:" + " got " << sequenceNumber << ", expected " << expectedSequenceNumber << "," + " increased timeout to " << setprecision(2) << timeout); running = false; } + else { + PTRACE(3, &m_session, *this << "late out of order packet: got " << sequenceNumber << ", expected " << expectedSequenceNumber); + } if (!running) { m_lateOutOfOrderAdaptTimer = m_lateOutOfOrderAdaptPeriod; m_lateOutOfOrderAdaptCount = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-13 10:41:10
|
Revision: 34843 http://sourceforge.net/p/opalvoip/code/34843 Author: rjongbloed Date: 2016-06-13 10:41:08 +0000 (Mon, 13 Jun 2016) Log Message: ----------- Log level tweak for media session abort Modified Paths: -------------- opal/trunk/src/rtp/rtp_session.cxx Modified: opal/trunk/src/rtp/rtp_session.cxx =================================================================== --- opal/trunk/src/rtp/rtp_session.cxx 2016-06-13 10:20:43 UTC (rev 34842) +++ opal/trunk/src/rtp/rtp_session.cxx 2016-06-13 10:41:08 UTC (rev 34843) @@ -2666,7 +2666,7 @@ /* Really should test if both data and control fail, but as it is unlikely we would get one failed without the other, we don't bother. */ if (subchannel == e_Data && m_connection.OnMediaFailed(m_sessionId)) { - PTRACE(3, *this << "aborting transport, queuing close of media session."); + PTRACE(2, *this << "aborting transport, queuing close of media session."); m_manager.QueueDecoupledEvent(new PSafeWorkNoArg<OpalRTPSession, bool>(this, &OpalRTPSession::Close)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-06-13 10:20:44
|
Revision: 34842 http://sourceforge.net/p/opalvoip/code/34842 Author: rjongbloed Date: 2016-06-13 10:20:43 +0000 (Mon, 13 Jun 2016) Log Message: ----------- Added protection against some pathological conditions where closed transport gets attached to a media session. Modified Paths: -------------- opal/trunk/src/rtp/rtp_session.cxx Modified: opal/trunk/src/rtp/rtp_session.cxx =================================================================== --- opal/trunk/src/rtp/rtp_session.cxx 2016-05-27 06:24:37 UTC (rev 34841) +++ opal/trunk/src/rtp/rtp_session.cxx 2016-06-13 10:20:43 UTC (rev 34842) @@ -787,6 +787,8 @@ void OpalRTPSession::InternalAttachTransport(const OpalMediaTransportPtr & newTransport PTRACE_PARAM(, const char * from)) { OpalMediaSession::AttachTransport(newTransport); + if (!IsOpen()) + return; newTransport->AddReadNotifier(m_dataNotifier, e_Data); if (!m_singlePortRx) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-27 06:24:39
|
Revision: 34841 http://sourceforge.net/p/opalvoip/code/34841 Author: rjongbloed Date: 2016-05-27 06:24:37 +0000 (Fri, 27 May 2016) Log Message: ----------- Merged revision(s) 34805-34839 from opal/branches/v3_16: Added PThread::WaitAndDelete() to handle thread termination management which is very common repeated code. Also, to aid debugging, this new function will, when termination exceeds a timeout, do stack walks of the thread being terminated and the thread waiting on termination. Modified Paths: -------------- opal/trunk/samples/callgen/main.cxx opal/trunk/samples/openphone/main.cxx opal/trunk/src/ep/opalmixer.cxx opal/trunk/src/ep/pcss.cxx opal/trunk/src/h323/gkclient.cxx opal/trunk/src/h323/gkserver.cxx opal/trunk/src/h323/peclient.cxx opal/trunk/src/im/msrp.cxx opal/trunk/src/lids/capi_ep.cxx opal/trunk/src/lids/lidep.cxx opal/trunk/src/lids/lidpluginmgr.cxx opal/trunk/src/opal/console_mgr.cxx opal/trunk/src/opal/manager.cxx opal/trunk/src/opal/mediasession.cxx opal/trunk/src/opal/patch.cxx opal/trunk/src/opal/pres_ent.cxx opal/trunk/src/opal/transports.cxx Property Changed: ---------------- opal/trunk/ Index: opal/trunk =================================================================== --- opal/trunk 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk 2016-05-27 06:24:37 UTC (rev 34841) Property changes on: opal/trunk ___________________________________________________________________ Modified: svn:mergeinfo ## -10,7 +10,7 ## /opal/branches/v3_10:25182-29485,30896,32927-32928,32933 /opal/branches/v3_12:28489-31709 /opal/branches/v3_14:31505-33613 -/opal/branches/v3_16:34090-34804 +/opal/branches/v3_16:34090-34839 /opal/branches/v3_2:21143,21220,21227,21253,21455 /opal/branches/v3_4:21060,21062,21088,21092,21111,21113,21115,21119,21143,21148,21151-21152,21155,21158,21184,21188,21253,21265-21266,21283-21284,21298,21300,21303,21307,21309,21311,21327,21331,21333,21359,21367,21369,21488,21556,21564-21565,21568,21570,21620,21625,21631,21748,21751,21756,21759,21761,21767,21770,22246,23044,23140,23143,23286 /opal/branches/v3_6:22169,22178,22184,22186,22197,22204,22216,22251,22253,22255,22258,22260,22291,22296,22300,22306,22308,22313,22319,22336,22353,22358,22436,22447,22449,22497,22511,22517,22519-22521,22527,22536,22538,22589,22596,22599,22617,22620,22622,22630,22640,22655,22675,22682,22726-22728,22730,22733,22738,22745-22746,22800,22820-22821,22842,22844-22845,22851,22853,22889,22896,22902,22904,22906,22918,22924,22928,22946,22965,22967,22976,22978,22980,22982,22994,23028,23123,23125-23126,23128,23157,23165,23173,23175,23183,23294,23341,23465,23467,23474,23521,23829,24346,24809 \ No newline at end of property Modified: opal/trunk/samples/callgen/main.cxx =================================================================== --- opal/trunk/samples/callgen/main.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/samples/callgen/main.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -705,8 +705,9 @@ } if (m_tone.IsEmpty()) { - m_tone.SetSampleRate(mediaStream.GetMediaFormat().GetClockRate()); - m_tone.Generate('-', 440, 0, 20); // 20ms of middle A + OpalMediaFormat mediaFormat = mediaStream.GetMediaFormat(); + m_tone.SetSampleRate(mediaFormat.GetClockRate()); + m_tone.Generate('-', 440, 0, std::max(mediaFormat.GetFrameTime()/mediaFormat.GetTimeUnits(), 20U)); // at least 20ms of middle A } PINDEX bytesLeft = (m_tone.GetSize() - m_toneOffset) / 2; Modified: opal/trunk/samples/openphone/main.cxx =================================================================== --- opal/trunk/samples/openphone/main.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/samples/openphone/main.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -5880,12 +5880,8 @@ if (m_TestVideoDisplay != NULL) m_TestVideoDisplay->Close(); - if (m_TestVideoThread != NULL) - m_TestVideoThread->WaitForTermination(); + PThread::WaitAndDelete(m_TestVideoThread); - delete m_TestVideoThread; - m_TestVideoThread = NULL; - delete m_TestVideoDisplay; m_TestVideoDisplay = NULL; Modified: opal/trunk/src/ep/opalmixer.cxx =================================================================== --- opal/trunk/src/ep/opalmixer.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/ep/opalmixer.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -223,20 +223,7 @@ void OpalBaseMixer::StopPushThread(bool lock) { - if (lock) - m_mutex.Wait(); - - PThread * thread = m_workerThread; - m_workerThread = NULL; - m_threadRunning = false; - - m_mutex.Signal(); - - if (thread != NULL) { - PTRACE(4, "Waiting for push thread " << *thread << " to terminate"); - PAssert(thread->WaitForTermination(5000), PSTRSTRM("Mixer worker thread " << *thread << " took too long to terminate.")); - delete thread; - } + PThread::WaitAndDelete(m_workerThread, 5000, &m_mutex, lock); } Modified: opal/trunk/src/ep/pcss.cxx =================================================================== --- opal/trunk/src/ep/pcss.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/ep/pcss.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -510,13 +510,8 @@ void OpalPCSSConnection::OnReleased() { - if (m_ringbackThread != NULL) { - PTRACE(4, "OnRelease stopping ringback thread"); - m_ringbackStop.Signal(); - m_ringbackThread->WaitForTermination(); - delete m_ringbackThread; - m_ringbackThread = NULL; - } + m_ringbackStop.Signal(); + PThread::WaitAndDelete(m_ringbackThread); StopReadUserInput(); @@ -763,9 +758,7 @@ PTRACE(3, "Stopping user input thread."); m_userInputChannel->Close(); - m_userInputThread->WaitForTermination(); - delete m_userInputThread; - m_userInputThread = NULL; + PThread::WaitAndDelete(m_userInputThread); if (m_userInputAutoDelete) delete m_userInputChannel; m_userInputChannel = NULL; Modified: opal/trunk/src/h323/gkclient.cxx =================================================================== --- opal/trunk/src/h323/gkclient.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/h323/gkclient.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -333,13 +333,9 @@ void H323Gatekeeper::StopChannel() { - if (m_monitorThread != NULL) { - m_monitorRunning = false; - m_monitorTickle.Signal(); - PAssert(m_monitorThread->WaitForTermination(10000), "Gatekeeper monitor thread did not stop"); - delete m_monitorThread; - m_monitorThread = 0; - } + m_monitorRunning = false; + m_monitorTickle.Signal(); + PThread::WaitAndDelete(m_monitorThread); H323Transactor::StopChannel(); } Modified: opal/trunk/src/h323/gkserver.cxx =================================================================== --- opal/trunk/src/h323/gkserver.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/h323/gkserver.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -2655,8 +2655,7 @@ H323GatekeeperServer::~H323GatekeeperServer() { monitorExit.Signal(); - PAssert(monitorThread->WaitForTermination(10000), "Gatekeeper monitor thread did not terminate!"); - delete monitorThread; + PThread::WaitAndDelete(m_monitorThread); #if OPAL_H501 delete m_peerElement; #endif Modified: opal/trunk/src/h323/peclient.cxx =================================================================== --- opal/trunk/src/h323/peclient.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/h323/peclient.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -209,8 +209,7 @@ if (monitor != NULL) { monitorStop = true; monitorTickle.Signal(); - monitor->WaitForTermination(); - delete monitor; + PThread::WaitAndDelete(monitor); } StopChannel(); Modified: opal/trunk/src/im/msrp.cxx =================================================================== --- opal/trunk/src/im/msrp.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/im/msrp.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -518,11 +518,8 @@ { PWaitAndSignal m(mutex); - if (m_listenerThread != NULL) { - m_listenerSocket.Close(); - m_listenerThread->WaitForTermination(); - delete m_listenerThread; - } + m_listenerSocket.Close(); + PThread::WaitAndDelete(m_listenerThread); } @@ -714,12 +711,9 @@ OpalMSRPManager::Connection::~Connection() { - if (m_handlerThread != NULL) { - m_running = false; - m_handlerThread->WaitForTermination(); - delete m_handlerThread; - m_handlerThread = NULL; - } + m_running = false; + PThread::WaitAndDelete(m_handlerThread); + delete m_protocol; m_protocol = NULL; PTRACE(3, "MSRP\tDestroying connection"); Modified: opal/trunk/src/lids/capi_ep.cxx =================================================================== --- opal/trunk/src/lids/capi_ep.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/lids/capi_ep.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -554,16 +554,13 @@ OpalCapiEndPoint::~OpalCapiEndPoint() { - if (m_thread != NULL) { - PTRACE(4, "LID EP\tAwaiting monitor thread termination " << GetPrefixName()); - OpalCapiFunctions::ApplID oldId = m_applicationId; - m_applicationId = 0; + OpalCapiFunctions::ApplID oldId = m_applicationId; + m_applicationId = 0; + if (oldId != 0) m_capi->RELEASE(oldId); - m_thread->WaitForTermination(); - delete m_thread; - m_thread = NULL; - } + PThread::WaitAndDelete(m_thread); + delete m_capi; PTRACE(4, "CAPI\tOpalCapiEndPoint destroyed"); Modified: opal/trunk/src/lids/lidep.cxx =================================================================== --- opal/trunk/src/lids/lidep.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/lids/lidep.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -63,21 +63,16 @@ OpalLineEndPoint::~OpalLineEndPoint() { - if(NULL != monitorThread) - { - PTRACE(4, "LID EP\tAwaiting monitor thread termination " << GetPrefixName()); - exitFlag.Signal(); - monitorThread->WaitForTermination(); - delete monitorThread; - monitorThread = NULL; + exitFlag.Signal(); + PThread::WaitAndDelete(monitorThread); - /* remove all lines which has been added with AddLine or AddLinesFromDevice - RemoveAllLines can be invoked only after the monitorThread has been destroyed, - indeed, the monitor thread may called some function such as vpb_get_event_ch_async which may - throw an exception if the line handle is no longer valid - */ - RemoveAllLines(); - } + /* remove all lines which has been added with AddLine or AddLinesFromDevice + RemoveAllLines can be invoked only after the monitorThread has been destroyed, + indeed, the monitor thread may called some function such as vpb_get_event_ch_async which may + throw an exception if the line handle is no longer valid + */ + RemoveAllLines(); + PTRACE(4, "LID EP\tOpalLineEndPoint " << GetPrefixName() << " destroyed"); } @@ -501,14 +496,9 @@ { PTRACE(3, "LID Con\tOnReleased " << *this); - if (handlerThread != NULL && PThread::Current() != handlerThread) { - PTRACE(4, "LID Con\tAwaiting handler thread termination " << *this); - // Stop the signalling handler thread - SetUserInput(PString()); // Break out of ReadUserInput - handlerThread->WaitForTermination(); - delete handlerThread; - handlerThread = NULL; - } + // Stop the signalling handler thread + SetUserInput(PString()); // Break out of ReadUserInput + PThread::WaitAndDelete(handlerThread); if (line.IsTerminal()) { if (line.IsOffHook()) { Modified: opal/trunk/src/lids/lidpluginmgr.cxx =================================================================== --- opal/trunk/src/lids/lidpluginmgr.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/lids/lidpluginmgr.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -1016,12 +1016,8 @@ void OpalPluginLID::StopTonePlayerThread() { // Stop previous tone, if running - if (m_tonePlayer != NULL) { - m_stopTone.Signal(); - m_tonePlayer->WaitForTermination(1000); - delete m_tonePlayer; - m_tonePlayer = NULL; - } + m_stopTone.Signal(); + PThread::WaitAndDelete(m_tonePlayer); } Modified: opal/trunk/src/opal/console_mgr.cxx =================================================================== --- opal/trunk/src/opal/console_mgr.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/opal/console_mgr.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -1655,13 +1655,9 @@ void OpalConsolePCSSEndPoint::ShutDown() { - if (m_ringThread != NULL) { - m_ringState = e_RingShutDown; - m_ringSignal.Signal(); - m_ringThread->WaitForTermination(); - delete m_ringThread; - m_ringThread = NULL; - } + m_ringState = e_RingShutDown; + m_ringSignal.Signal(); + PThread::WaitAndDelete(m_ringThread); OpalPCSSEndPoint::ShutDown(); } Modified: opal/trunk/src/opal/manager.cxx =================================================================== --- opal/trunk/src/opal/manager.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/opal/manager.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -409,11 +409,8 @@ #endif // Shut down the cleaner thread - if (m_garbageCollector != NULL) { - m_garbageCollectExit.Signal(); - m_garbageCollector->WaitForTermination(); - delete m_garbageCollector; - } + m_garbageCollectExit.Signal(); + PThread::WaitAndDelete(m_garbageCollector); // Clean up any calls that the cleaner thread missed on the way out GarbageCollection(); Modified: opal/trunk/src/opal/mediasession.cxx =================================================================== --- opal/trunk/src/opal/mediasession.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/opal/mediasession.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -745,9 +745,17 @@ for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) { if (it->m_channel != NULL) { PChannel * base = it->m_channel->GetBaseReadChannel(); - if (base != NULL) + if (base != NULL) { + PTRACE(4, *this << it->m_subchannel << " closing."); base->Close(); + } + else { + PTRACE(3, *this << it->m_subchannel << " already closed."); + } } + else { + PTRACE(3, *this << it->m_subchannel << " not created."); + } } UnlockReadOnly(); @@ -802,15 +810,14 @@ void OpalMediaTransport::InternalStop() { - PTRACE(4, *this << "stopping " << m_subchannels.size() << "subchannels."); + if (m_subchannels.empty()) + return; + + PTRACE(4, *this << "stopping " << m_subchannels.size() << " subchannels."); InternalClose(); - for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) { - if (it->m_thread != NULL) { - PAssert(it->m_thread->WaitForTermination(10000), "RTP thread failed to terminate"); - delete it->m_thread; - } - } + for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) + PThread::WaitAndDelete(it->m_thread); LockReadWrite(); for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) Modified: opal/trunk/src/opal/patch.cxx =================================================================== --- opal/trunk/src/opal/patch.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/opal/patch.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -179,20 +179,7 @@ void OpalMediaPatch::StopThread() { - m_patchThreadMutex.Wait(); - PThread * thread = m_patchThread; - m_patchThread = NULL; - m_patchThreadMutex.Signal(); - - if (thread == NULL) - return; - - if (!thread->IsSuspended()) { - PTRACE(4, "Waiting for media patch thread to stop " << *this); - PAssert(thread->WaitForTermination(10000), "Media patch thread not terminated."); - } - - delete thread; + PThread::WaitAndDelete(m_patchThread, 10000, &m_patchThreadMutex); } Modified: opal/trunk/src/opal/pres_ent.cxx =================================================================== --- opal/trunk/src/opal/pres_ent.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/opal/pres_ent.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -589,14 +589,9 @@ void OpalPresentityWithCommandThread::StopThread() { - if (m_threadRunning && m_thread != NULL) { - PTRACE(4, "Stopping command thread " << *m_thread); - m_threadRunning = false; - m_commandQueueSync.Signal(); - PAssert(m_thread->WaitForTermination(5000), "Could not terminate presentity command thread"); - delete m_thread; - m_thread = NULL; - } + m_threadRunning = false; + m_commandQueueSync.Signal(); + PThread::WaitAndDelete(m_thread); } Modified: opal/trunk/src/opal/transports.cxx =================================================================== --- opal/trunk/src/opal/transports.cxx 2016-05-27 06:18:43 UTC (rev 34840) +++ opal/trunk/src/opal/transports.cxx 2016-05-27 06:24:37 UTC (rev 34841) @@ -650,31 +650,12 @@ } -static void WaitForTransportThread(PThread * thread, const OpalEndPoint & endpoint) -{ - if (thread == NULL) - return; - - if (PThread::Current() == thread) { - thread->SetAutoDelete(); - return; - } - - PTimeInterval timeout(0, 2); // Seconds of grace - timeout += endpoint.GetManager().GetSignalingTimeout(); - PAssert(thread->WaitForTermination(timeout), "Transport/Listener thread did not terminate"); - delete thread; -} - - void OpalListener::CloseWait() { PTRACE(3, "Stopping listening thread on " << GetLocalAddress()); Close(); - PThread * exitingThread = m_thread; - m_thread = NULL; - WaitForTransportThread(exitingThread, m_endpoint); + PThread::WaitAndDelete(m_thread, m_endpoint.GetManager().GetSignalingTimeout()+2000); } @@ -1096,7 +1077,7 @@ m_keepAliveTimer.Stop(); - WaitForTransportThread(exitingThread, m_endpoint); + PThread::WaitAndDelete(exitingThread, m_endpoint.GetManager().GetSignalingTimeout()+2000); } @@ -1136,10 +1117,7 @@ { PTRACE_CONTEXT_ID_TO(thrd); - if (m_thread != NULL) { - PAssert(m_thread->WaitForTermination(10000), "Transport not terminated when reattaching thread"); - delete m_thread; - } + PThread::WaitAndDelete(m_thread); m_thread = thrd; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-27 06:18:45
|
Revision: 34840 http://sourceforge.net/p/opalvoip/code/34840 Author: rjongbloed Date: 2016-05-27 06:18:43 +0000 (Fri, 27 May 2016) Log Message: ----------- Merged revision(s) 34834-34839 from ptlib/branches/v2_16: Added PThread::WaitAndDelete() to handle thread termination management which is very common repeated code. Also, to aid debugging, this new function will, when termination exceeds a timeout, do stack walks of the thread being terminated and the thread waiting on termination. Modified Paths: -------------- ptlib/trunk/include/ptlib/thread.h ptlib/trunk/src/ptclib/cli.cxx ptlib/trunk/src/ptclib/vxml.cxx ptlib/trunk/src/ptlib/common/osutils.cxx ptlib/trunk/src/ptlib/msos/vfw.cxx Property Changed: ---------------- ptlib/trunk/ Index: ptlib/trunk =================================================================== --- ptlib/trunk 2016-05-27 06:09:28 UTC (rev 34839) +++ ptlib/trunk 2016-05-27 06:18:43 UTC (rev 34840) Property changes on: ptlib/trunk ___________________________________________________________________ Modified: svn:mergeinfo ## -6,7 +6,7 ## /ptlib/branches/v2_10:25177-29189,32921,32947 /ptlib/branches/v2_12:28485-31603 /ptlib/branches/v2_14:31501-33720 -/ptlib/branches/v2_16:34085-34833 +/ptlib/branches/v2_16:34085-34839 /ptlib/branches/v2_2:20746,20791,20827,22014,22942 /ptlib/branches/v2_4:21086,21094,21147,21160,21185,21281,21296,21305,21322,21337,21363,21467,21471-21472,21506,21508,21623,21695,21744,21746,21763,22241,22958,23045-23046,23061,23066,23712 /ptlib/branches/v2_6:22195,22243,22295,22304,22311,22317,22320,22356,22458,22509,22587,22601-22602,22611,22629,22633,22673,22681,22729,22731-22732,22736,22742,22848,22960,22992,23161,23163,23167,23169,23177,23239,23291,23298,23336,23429,23595,23823,23827,23873,24816 \ No newline at end of property Modified: ptlib/trunk/include/ptlib/thread.h =================================================================== --- ptlib/trunk/include/ptlib/thread.h 2016-05-27 06:09:28 UTC (rev 34839) +++ ptlib/trunk/include/ptlib/thread.h 2016-05-27 06:18:43 UTC (rev 34840) @@ -187,6 +187,27 @@ const PTimeInterval & maxWait ///< Maximum time to wait for termination. ) const; + /**Wait for thread termination and delete object. + The thread pointer is set to NULL within an optional mutex. The mutex is + released before waiting for thread termination, which avoids deadlock + scenarios. The \p lock parameter indicates if the mutex is already locked + on entry and should not be locked again, preventing the unlock from + occurring due to nested mutex semantics. + + If the \p maxTime timeout occurs, the thread is preemptively destroyed + which is very likely to cause many issues, see PThread::Terminate() so + a PAssert is raised when this condition occurs. + + @return + <code>true</code> if the thread forcibly terminated, <code>false</code> if orderly exit. + */ + static bool WaitAndDelete( + PThread * & thread, ///< Thread to delete + const PTimeInterval & maxWait = 10000, ///< Maximum time to wait for termination. + PMutex * mutex = NULL, ///< Optional mutex to protect setting of thread variable + bool lock = true ///< Mutex should be locked. + ); + /** Suspend or resume the thread. If <code>susp</code> is <code>true</code> this increments an internal count of Modified: ptlib/trunk/src/ptclib/cli.cxx =================================================================== --- ptlib/trunk/src/ptclib/cli.cxx 2016-05-27 06:09:28 UTC (rev 34839) +++ ptlib/trunk/src/ptclib/cli.cxx 2016-05-27 06:18:43 UTC (rev 34840) @@ -125,12 +125,7 @@ PChannel * base = GetBaseReadChannel(); if (base != NULL) base->Close(); - - if (m_thread != NULL && PThread::Current() != m_thread) { - m_thread->WaitForTermination(10000); - delete m_thread; - m_thread = NULL; - } + PThread::WaitAndDelete(m_thread); } @@ -1117,13 +1112,8 @@ void PCLISocket::Stop() { m_listenSocket.Close(); + PThread::WaitAndDelete(m_thread); - if (m_thread != NULL && PThread::Current() != m_thread) { - m_thread->WaitForTermination(10000); - delete m_thread; - m_thread = NULL; - } - PCLI::Stop(); } Modified: ptlib/trunk/src/ptclib/vxml.cxx =================================================================== --- ptlib/trunk/src/ptclib/vxml.cxx 2016-05-27 06:09:28 UTC (rev 34839) +++ ptlib/trunk/src/ptclib/vxml.cxx 2016-05-27 06:18:43 UTC (rev 34840) @@ -1095,30 +1095,15 @@ PBoolean PVXMLSession::Close() { - PThread * thread = NULL; - m_sessionMutex.Wait(); LoadGrammar(NULL); - if (PThread::Current() != m_vxmlThread) { - thread = m_vxmlThread; - m_vxmlThread = NULL; - } + // Stop condition for thread + m_abortVXML = true; + Trigger(); + PThread::WaitAndDelete(m_vxmlThread, 10000, &m_sessionMutex, false); - m_sessionMutex.Signal(); - - if (thread != NULL) { - PTRACE(3, "VXML\tClosing session, fast forwarding through script"); - - // Stop condition for thread - m_abortVXML = true; - Trigger(); - - PAssert(thread->WaitForTermination(10000), "VXML thread did not exit in time."); - delete thread; - } - return PIndirectChannel::Close(); } Modified: ptlib/trunk/src/ptlib/common/osutils.cxx =================================================================== --- ptlib/trunk/src/ptlib/common/osutils.cxx 2016-05-27 06:09:28 UTC (rev 34839) +++ ptlib/trunk/src/ptlib/common/osutils.cxx 2016-05-27 06:18:43 UTC (rev 34840) @@ -2817,6 +2817,55 @@ } +bool PThread::WaitAndDelete(PThread * & threadToDelete, const PTimeInterval & maxWait, PMutex * mutex, bool lock) +{ + if (mutex != NULL && lock) + mutex->Wait(); + + PThread * thread = threadToDelete; + threadToDelete = NULL; + + if (mutex != NULL) + mutex->Signal(); + + if (thread == NULL) + return false; + + if (PThread::Current() == thread) { + // Is me! + thread->SetAutoDelete(); + return false; + } + + if (thread->IsSuspended()) { + // Ended before it started + delete thread; + return false; + } + + PTRACE(4, thread, "Waiting for thread " << *thread << " to terminate in " << maxWait << " seconds"); + if (thread->WaitForTermination(maxWait)) { + // Orderly exit + delete thread; + return false; + } + + ostringstream strm; + strm << "Thread \"" << *thread << "\"" +#if PTRACING + "\n"; + PTrace::WalkStack(strm, thread->GetThreadId()); + strm << " " +#endif + " failed to terminate in " << maxWait << " seconds"; + PAssertAlways(strm.str().c_str()); + + delete thread; + + return true; +} + + #define RELEASE_THREAD_LOCAL_STORAGE 1 #if RELEASE_THREAD_LOCAL_STORAGE static std::set<PThread::LocalStorageBase*> s_ThreadLocalStorage; Modified: ptlib/trunk/src/ptlib/msos/vfw.cxx =================================================================== --- ptlib/trunk/src/ptlib/msos/vfw.cxx 2016-05-27 06:09:28 UTC (rev 34839) +++ ptlib/trunk/src/ptlib/msos/vfw.cxx 2016-05-27 06:18:43 UTC (rev 34840) @@ -1399,11 +1399,7 @@ SendMessage(m_hWnd, WM_CLOSE, 0, 0); - if (m_thread != NULL) { - m_thread->WaitForTermination(3000); - delete m_thread; - m_thread = NULL; - } + PThread::WaitAndDelete(m_thread, 3000); return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-27 06:09:31
|
Revision: 34839 http://sourceforge.net/p/opalvoip/code/34839 Author: rjongbloed Date: 2016-05-27 06:09:28 +0000 (Fri, 27 May 2016) Log Message: ----------- Added PThread::WaitAndDelete() to handle thread termination management which is very common repeated code. Also, to aid debugging, this new function will, when termination exceeds a timeout, do stack walks of the thread being terminated and the thread waiting on termination. Modified Paths: -------------- opal/branches/v3_16/samples/openphone/main.cxx opal/branches/v3_16/src/ep/opalmixer.cxx opal/branches/v3_16/src/ep/pcss.cxx opal/branches/v3_16/src/h323/gkclient.cxx opal/branches/v3_16/src/h323/gkserver.cxx opal/branches/v3_16/src/h323/peclient.cxx opal/branches/v3_16/src/im/msrp.cxx opal/branches/v3_16/src/lids/capi_ep.cxx opal/branches/v3_16/src/lids/lidep.cxx opal/branches/v3_16/src/lids/lidpluginmgr.cxx opal/branches/v3_16/src/opal/console_mgr.cxx opal/branches/v3_16/src/opal/manager.cxx opal/branches/v3_16/src/opal/mediasession.cxx opal/branches/v3_16/src/opal/patch.cxx opal/branches/v3_16/src/opal/pres_ent.cxx opal/branches/v3_16/src/opal/transports.cxx ptlib/branches/v2_16/include/ptlib/thread.h ptlib/branches/v2_16/src/ptclib/cli.cxx ptlib/branches/v2_16/src/ptclib/vxml.cxx ptlib/branches/v2_16/src/ptlib/common/osutils.cxx ptlib/branches/v2_16/src/ptlib/msos/vfw.cxx Modified: opal/branches/v3_16/samples/openphone/main.cxx =================================================================== --- opal/branches/v3_16/samples/openphone/main.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/samples/openphone/main.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -5875,12 +5875,8 @@ if (m_TestVideoDisplay != NULL) m_TestVideoDisplay->Close(); - if (m_TestVideoThread != NULL) - m_TestVideoThread->WaitForTermination(); + PThread::WaitAndDelete(m_TestVideoThread); - delete m_TestVideoThread; - m_TestVideoThread = NULL; - delete m_TestVideoDisplay; m_TestVideoDisplay = NULL; Modified: opal/branches/v3_16/src/ep/opalmixer.cxx =================================================================== --- opal/branches/v3_16/src/ep/opalmixer.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/ep/opalmixer.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -223,20 +223,7 @@ void OpalBaseMixer::StopPushThread(bool lock) { - if (lock) - m_mutex.Wait(); - - PThread * thread = m_workerThread; - m_workerThread = NULL; - m_threadRunning = false; - - m_mutex.Signal(); - - if (thread != NULL) { - PTRACE(4, "Waiting for push thread " << *thread << " to terminate"); - PAssert(thread->WaitForTermination(5000), PSTRSTRM("Mixer worker thread " << *thread << " took too long to terminate.")); - delete thread; - } + PThread::WaitAndDelete(m_workerThread, 5000, &m_mutex, lock); } Modified: opal/branches/v3_16/src/ep/pcss.cxx =================================================================== --- opal/branches/v3_16/src/ep/pcss.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/ep/pcss.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -510,13 +510,8 @@ void OpalPCSSConnection::OnReleased() { - if (m_ringbackThread != NULL) { - PTRACE(4, "OnRelease stopping ringback thread"); - m_ringbackStop.Signal(); - m_ringbackThread->WaitForTermination(); - delete m_ringbackThread; - m_ringbackThread = NULL; - } + m_ringbackStop.Signal(); + PThread::WaitAndDelete(m_ringbackThread); StopReadUserInput(); @@ -763,9 +758,7 @@ PTRACE(3, "Stopping user input thread."); m_userInputChannel->Close(); - m_userInputThread->WaitForTermination(); - delete m_userInputThread; - m_userInputThread = NULL; + PThread::WaitAndDelete(m_userInputThread); if (m_userInputAutoDelete) delete m_userInputChannel; m_userInputChannel = NULL; Modified: opal/branches/v3_16/src/h323/gkclient.cxx =================================================================== --- opal/branches/v3_16/src/h323/gkclient.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/h323/gkclient.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -283,13 +283,9 @@ void H323Gatekeeper::StopChannel() { - if (m_monitorThread != NULL) { - m_monitorRunning = false; - m_monitorTickle.Signal(); - PAssert(m_monitorThread->WaitForTermination(10000), "Gatekeeper monitor thread did not stop"); - delete m_monitorThread; - m_monitorThread = 0; - } + m_monitorRunning = false; + m_monitorTickle.Signal(); + PThread::WaitAndDelete(m_monitorThread); H323Transactor::StopChannel(); } Modified: opal/branches/v3_16/src/h323/gkserver.cxx =================================================================== --- opal/branches/v3_16/src/h323/gkserver.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/h323/gkserver.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -2655,8 +2655,7 @@ H323GatekeeperServer::~H323GatekeeperServer() { monitorExit.Signal(); - PAssert(monitorThread->WaitForTermination(10000), "Gatekeeper monitor thread did not terminate!"); - delete monitorThread; + PThread::WaitAndDelete(m_monitorThread); #if OPAL_H501 delete m_peerElement; #endif Modified: opal/branches/v3_16/src/h323/peclient.cxx =================================================================== --- opal/branches/v3_16/src/h323/peclient.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/h323/peclient.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -209,8 +209,7 @@ if (monitor != NULL) { monitorStop = true; monitorTickle.Signal(); - monitor->WaitForTermination(); - delete monitor; + PThread::WaitAndDelete(monitor); } StopChannel(); Modified: opal/branches/v3_16/src/im/msrp.cxx =================================================================== --- opal/branches/v3_16/src/im/msrp.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/im/msrp.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -518,11 +518,8 @@ { PWaitAndSignal m(mutex); - if (m_listenerThread != NULL) { - m_listenerSocket.Close(); - m_listenerThread->WaitForTermination(); - delete m_listenerThread; - } + m_listenerSocket.Close(); + PThread::WaitAndDelete(m_listenerThread); } @@ -714,12 +711,9 @@ OpalMSRPManager::Connection::~Connection() { - if (m_handlerThread != NULL) { - m_running = false; - m_handlerThread->WaitForTermination(); - delete m_handlerThread; - m_handlerThread = NULL; - } + m_running = false; + PThread::WaitAndDelete(m_handlerThread); + delete m_protocol; m_protocol = NULL; PTRACE(3, "MSRP\tDestroying connection"); Modified: opal/branches/v3_16/src/lids/capi_ep.cxx =================================================================== --- opal/branches/v3_16/src/lids/capi_ep.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/lids/capi_ep.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -554,16 +554,13 @@ OpalCapiEndPoint::~OpalCapiEndPoint() { - if (m_thread != NULL) { - PTRACE(4, "LID EP\tAwaiting monitor thread termination " << GetPrefixName()); - OpalCapiFunctions::ApplID oldId = m_applicationId; - m_applicationId = 0; + OpalCapiFunctions::ApplID oldId = m_applicationId; + m_applicationId = 0; + if (oldId != 0) m_capi->RELEASE(oldId); - m_thread->WaitForTermination(); - delete m_thread; - m_thread = NULL; - } + PThread::WaitAndDelete(m_thread); + delete m_capi; PTRACE(4, "CAPI\tOpalCapiEndPoint destroyed"); Modified: opal/branches/v3_16/src/lids/lidep.cxx =================================================================== --- opal/branches/v3_16/src/lids/lidep.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/lids/lidep.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -63,21 +63,16 @@ OpalLineEndPoint::~OpalLineEndPoint() { - if(NULL != monitorThread) - { - PTRACE(4, "LID EP\tAwaiting monitor thread termination " << GetPrefixName()); - exitFlag.Signal(); - monitorThread->WaitForTermination(); - delete monitorThread; - monitorThread = NULL; + exitFlag.Signal(); + PThread::WaitAndDelete(monitorThread); - /* remove all lines which has been added with AddLine or AddLinesFromDevice - RemoveAllLines can be invoked only after the monitorThread has been destroyed, - indeed, the monitor thread may called some function such as vpb_get_event_ch_async which may - throw an exception if the line handle is no longer valid - */ - RemoveAllLines(); - } + /* remove all lines which has been added with AddLine or AddLinesFromDevice + RemoveAllLines can be invoked only after the monitorThread has been destroyed, + indeed, the monitor thread may called some function such as vpb_get_event_ch_async which may + throw an exception if the line handle is no longer valid + */ + RemoveAllLines(); + PTRACE(4, "LID EP\tOpalLineEndPoint " << GetPrefixName() << " destroyed"); } @@ -501,14 +496,9 @@ { PTRACE(3, "LID Con\tOnReleased " << *this); - if (handlerThread != NULL && PThread::Current() != handlerThread) { - PTRACE(4, "LID Con\tAwaiting handler thread termination " << *this); - // Stop the signalling handler thread - SetUserInput(PString()); // Break out of ReadUserInput - handlerThread->WaitForTermination(); - delete handlerThread; - handlerThread = NULL; - } + // Stop the signalling handler thread + SetUserInput(PString()); // Break out of ReadUserInput + PThread::WaitAndDelete(handlerThread); if (line.IsTerminal()) { if (line.IsOffHook()) { Modified: opal/branches/v3_16/src/lids/lidpluginmgr.cxx =================================================================== --- opal/branches/v3_16/src/lids/lidpluginmgr.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/lids/lidpluginmgr.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -1016,12 +1016,8 @@ void OpalPluginLID::StopTonePlayerThread() { // Stop previous tone, if running - if (m_tonePlayer != NULL) { - m_stopTone.Signal(); - m_tonePlayer->WaitForTermination(1000); - delete m_tonePlayer; - m_tonePlayer = NULL; - } + m_stopTone.Signal(); + PThread::WaitAndDelete(m_tonePlayer); } Modified: opal/branches/v3_16/src/opal/console_mgr.cxx =================================================================== --- opal/branches/v3_16/src/opal/console_mgr.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/opal/console_mgr.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -1657,13 +1657,9 @@ void OpalConsolePCSSEndPoint::ShutDown() { - if (m_ringThread != NULL) { - m_ringState = e_RingShutDown; - m_ringSignal.Signal(); - m_ringThread->WaitForTermination(); - delete m_ringThread; - m_ringThread = NULL; - } + m_ringState = e_RingShutDown; + m_ringSignal.Signal(); + PThread::WaitAndDelete(m_ringThread); OpalPCSSEndPoint::ShutDown(); } Modified: opal/branches/v3_16/src/opal/manager.cxx =================================================================== --- opal/branches/v3_16/src/opal/manager.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/opal/manager.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -411,11 +411,8 @@ #endif // Shut down the cleaner thread - if (m_garbageCollector != NULL) { - m_garbageCollectExit.Signal(); - m_garbageCollector->WaitForTermination(); - delete m_garbageCollector; - } + m_garbageCollectExit.Signal(); + PThread::WaitAndDelete(m_garbageCollector); // Clean up any calls that the cleaner thread missed on the way out GarbageCollection(); Modified: opal/branches/v3_16/src/opal/mediasession.cxx =================================================================== --- opal/branches/v3_16/src/opal/mediasession.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/opal/mediasession.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -745,9 +745,17 @@ for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) { if (it->m_channel != NULL) { PChannel * base = it->m_channel->GetBaseReadChannel(); - if (base != NULL) + if (base != NULL) { + PTRACE(4, *this << it->m_subchannel << " closing."); base->Close(); + } + else { + PTRACE(3, *this << it->m_subchannel << " already closed."); + } } + else { + PTRACE(3, *this << it->m_subchannel << " not created."); + } } UnlockReadOnly(); @@ -802,15 +810,14 @@ void OpalMediaTransport::InternalStop() { - PTRACE(4, *this << "stopping " << m_subchannels.size() << "subchannels."); + if (m_subchannels.empty()) + return; + + PTRACE(4, *this << "stopping " << m_subchannels.size() << " subchannels."); InternalClose(); - for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) { - if (it->m_thread != NULL) { - PAssert(it->m_thread->WaitForTermination(10000), "RTP thread failed to terminate"); - delete it->m_thread; - } - } + for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) + PThread::WaitAndDelete(it->m_thread); LockReadWrite(); for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) Modified: opal/branches/v3_16/src/opal/patch.cxx =================================================================== --- opal/branches/v3_16/src/opal/patch.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/opal/patch.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -179,20 +179,7 @@ void OpalMediaPatch::StopThread() { - m_patchThreadMutex.Wait(); - PThread * thread = m_patchThread; - m_patchThread = NULL; - m_patchThreadMutex.Signal(); - - if (thread == NULL) - return; - - if (!thread->IsSuspended()) { - PTRACE(4, "Waiting for media patch thread to stop " << *this); - PAssert(thread->WaitForTermination(10000), "Media patch thread not terminated."); - } - - delete thread; + PThread::WaitAndDelete(m_patchThread, 10000, &m_patchThreadMutex); } Modified: opal/branches/v3_16/src/opal/pres_ent.cxx =================================================================== --- opal/branches/v3_16/src/opal/pres_ent.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/opal/pres_ent.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -589,14 +589,9 @@ void OpalPresentityWithCommandThread::StopThread() { - if (m_threadRunning && m_thread != NULL) { - PTRACE(4, "Stopping command thread " << *m_thread); - m_threadRunning = false; - m_commandQueueSync.Signal(); - PAssert(m_thread->WaitForTermination(5000), "Could not terminate presentity command thread"); - delete m_thread; - m_thread = NULL; - } + m_threadRunning = false; + m_commandQueueSync.Signal(); + PThread::WaitAndDelete(m_thread); } Modified: opal/branches/v3_16/src/opal/transports.cxx =================================================================== --- opal/branches/v3_16/src/opal/transports.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ opal/branches/v3_16/src/opal/transports.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -650,31 +650,12 @@ } -static void WaitForTransportThread(PThread * thread, const OpalEndPoint & endpoint) -{ - if (thread == NULL) - return; - - if (PThread::Current() == thread) { - thread->SetAutoDelete(); - return; - } - - PTimeInterval timeout(0, 2); // Seconds of grace - timeout += endpoint.GetManager().GetSignalingTimeout(); - PAssert(thread->WaitForTermination(timeout), "Transport/Listener thread did not terminate"); - delete thread; -} - - void OpalListener::CloseWait() { PTRACE(3, "Stopping listening thread on " << GetLocalAddress()); Close(); - PThread * exitingThread = m_thread; - m_thread = NULL; - WaitForTransportThread(exitingThread, m_endpoint); + PThread::WaitAndDelete(m_thread, m_endpoint.GetManager().GetSignalingTimeout()+2000); } @@ -1096,7 +1077,7 @@ m_keepAliveTimer.Stop(); - WaitForTransportThread(exitingThread, m_endpoint); + PThread::WaitAndDelete(exitingThread, m_endpoint.GetManager().GetSignalingTimeout()+2000); } @@ -1136,10 +1117,7 @@ { PTRACE_CONTEXT_ID_TO(thrd); - if (m_thread != NULL) { - PAssert(m_thread->WaitForTermination(10000), "Transport not terminated when reattaching thread"); - delete m_thread; - } + PThread::WaitAndDelete(m_thread); m_thread = thrd; } Modified: ptlib/branches/v2_16/include/ptlib/thread.h =================================================================== --- ptlib/branches/v2_16/include/ptlib/thread.h 2016-05-27 05:20:55 UTC (rev 34838) +++ ptlib/branches/v2_16/include/ptlib/thread.h 2016-05-27 06:09:28 UTC (rev 34839) @@ -187,6 +187,27 @@ const PTimeInterval & maxWait ///< Maximum time to wait for termination. ) const; + /**Wait for thread termination and delete object. + The thread pointer is set to NULL within an optional mutex. The mutex is + released before waiting for thread termination, which avoids deadlock + scenarios. The \p lock parameter indicates if the mutex is already locked + on entry and should not be locked again, preventing the unlock from + occurring due to nested mutex semantics. + + If the \p maxTime timeout occurs, the thread is preemptively destroyed + which is very likely to cause many issues, see PThread::Terminate() so + a PAssert is raised when this condition occurs. + + @return + <code>true</code> if the thread forcibly terminated, <code>false</code> if orderly exit. + */ + static bool WaitAndDelete( + PThread * & thread, ///< Thread to delete + const PTimeInterval & maxWait = 10000, ///< Maximum time to wait for termination. + PMutex * mutex = NULL, ///< Optional mutex to protect setting of thread variable + bool lock = true ///< Mutex should be locked. + ); + /** Suspend or resume the thread. If <code>susp</code> is <code>true</code> this increments an internal count of Modified: ptlib/branches/v2_16/src/ptclib/cli.cxx =================================================================== --- ptlib/branches/v2_16/src/ptclib/cli.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ ptlib/branches/v2_16/src/ptclib/cli.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -125,12 +125,7 @@ PChannel * base = GetBaseReadChannel(); if (base != NULL) base->Close(); - - if (m_thread != NULL && PThread::Current() != m_thread) { - m_thread->WaitForTermination(10000); - delete m_thread; - m_thread = NULL; - } + PThread::WaitAndDelete(m_thread); } @@ -1117,13 +1112,8 @@ void PCLISocket::Stop() { m_listenSocket.Close(); + PThread::WaitAndDelete(m_thread); - if (m_thread != NULL && PThread::Current() != m_thread) { - m_thread->WaitForTermination(10000); - delete m_thread; - m_thread = NULL; - } - PCLI::Stop(); } Modified: ptlib/branches/v2_16/src/ptclib/vxml.cxx =================================================================== --- ptlib/branches/v2_16/src/ptclib/vxml.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ ptlib/branches/v2_16/src/ptclib/vxml.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -1095,30 +1095,15 @@ PBoolean PVXMLSession::Close() { - PThread * thread = NULL; - m_sessionMutex.Wait(); LoadGrammar(NULL); - if (PThread::Current() != m_vxmlThread) { - thread = m_vxmlThread; - m_vxmlThread = NULL; - } + // Stop condition for thread + m_abortVXML = true; + Trigger(); + PThread::WaitAndDelete(m_vxmlThread, 10000, &m_sessionMutex, false); - m_sessionMutex.Signal(); - - if (thread != NULL) { - PTRACE(3, "VXML\tClosing session, fast forwarding through script"); - - // Stop condition for thread - m_abortVXML = true; - Trigger(); - - PAssert(thread->WaitForTermination(10000), "VXML thread did not exit in time."); - delete thread; - } - return PIndirectChannel::Close(); } Modified: ptlib/branches/v2_16/src/ptlib/common/osutils.cxx =================================================================== --- ptlib/branches/v2_16/src/ptlib/common/osutils.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ ptlib/branches/v2_16/src/ptlib/common/osutils.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -2806,6 +2806,55 @@ } +bool PThread::WaitAndDelete(PThread * & threadToDelete, const PTimeInterval & maxWait, PMutex * mutex, bool lock) +{ + if (mutex != NULL && lock) + mutex->Wait(); + + PThread * thread = threadToDelete; + threadToDelete = NULL; + + if (mutex != NULL) + mutex->Signal(); + + if (thread == NULL) + return false; + + if (PThread::Current() == thread) { + // Is me! + thread->SetAutoDelete(); + return false; + } + + if (thread->IsSuspended()) { + // Ended before it started + delete thread; + return false; + } + + PTRACE(4, thread, "Waiting for thread " << *thread << " to terminate in " << maxWait << " seconds"); + if (thread->WaitForTermination(maxWait)) { + // Orderly exit + delete thread; + return false; + } + + ostringstream strm; + strm << "Thread \"" << *thread << "\"" +#if PTRACING + "\n"; + PTrace::WalkStack(strm, thread->GetThreadId()); + strm << " " +#endif + " failed to terminate in " << maxWait << " seconds"; + PAssertAlways(strm.str().c_str()); + + delete thread; + + return true; +} + + PThread::~PThread() { if (m_type != e_IsProcess && m_type != e_IsExternal && !WaitForTermination(100)) Modified: ptlib/branches/v2_16/src/ptlib/msos/vfw.cxx =================================================================== --- ptlib/branches/v2_16/src/ptlib/msos/vfw.cxx 2016-05-27 05:20:55 UTC (rev 34838) +++ ptlib/branches/v2_16/src/ptlib/msos/vfw.cxx 2016-05-27 06:09:28 UTC (rev 34839) @@ -1399,11 +1399,7 @@ SendMessage(m_hWnd, WM_CLOSE, 0, 0); - if (m_thread != NULL) { - m_thread->WaitForTermination(3000); - delete m_thread; - m_thread = NULL; - } + PThread::WaitAndDelete(m_thread, 3000); return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-27 05:20:58
|
Revision: 34838 http://sourceforge.net/p/opalvoip/code/34838 Author: rjongbloed Date: 2016-05-27 05:20:55 +0000 (Fri, 27 May 2016) Log Message: ----------- Small improvement to tone generation in callgen app. Modified Paths: -------------- opal/branches/v3_16/samples/callgen/main.cxx Modified: opal/branches/v3_16/samples/callgen/main.cxx =================================================================== --- opal/branches/v3_16/samples/callgen/main.cxx 2016-05-26 22:57:19 UTC (rev 34837) +++ opal/branches/v3_16/samples/callgen/main.cxx 2016-05-27 05:20:55 UTC (rev 34838) @@ -705,8 +705,9 @@ } if (m_tone.IsEmpty()) { - m_tone.SetSampleRate(mediaStream.GetMediaFormat().GetClockRate()); - m_tone.Generate('-', 440, 0, 20); // 20ms of middle A + OpalMediaFormat mediaFormat = mediaStream.GetMediaFormat(); + m_tone.SetSampleRate(mediaFormat.GetClockRate()); + m_tone.Generate('-', 440, 0, std::max(mediaFormat.GetFrameTime()/mediaFormat.GetTimeUnits(), 20U)); // at least 20ms of middle A } PINDEX bytesLeft = (m_tone.GetSize() - m_toneOffset) / 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-26 22:57:22
|
Revision: 34837 http://sourceforge.net/p/opalvoip/code/34837 Author: rjongbloed Date: 2016-05-26 22:57:19 +0000 (Thu, 26 May 2016) Log Message: ----------- Improved documentation around PString::SetSize() usage. Modified Paths: -------------- ptlib/trunk/include/ptlib/pstring.h Modified: ptlib/trunk/include/ptlib/pstring.h =================================================================== --- ptlib/trunk/include/ptlib/pstring.h 2016-05-25 03:18:08 UTC (rev 34836) +++ ptlib/trunk/include/ptlib/pstring.h 2016-05-26 22:57:19 UTC (rev 34837) @@ -543,6 +543,10 @@ new characters are initialised to zero. If the string is made smaller then the data beyond the new size is lost. + This does not set the actual length of the string, but only allocates + space for it. It is expected that GetPointerAndSetLength() or + MakeMinimumSize() is used to set the actual length of the string. + Note that this function will break the current instance from multiple references to an array. A new array is allocated and the data from the old array copied to it. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-25 03:18:10
|
Revision: 34836 http://sourceforge.net/p/opalvoip/code/34836 Author: rjongbloed Date: 2016-05-25 03:18:08 +0000 (Wed, 25 May 2016) Log Message: ----------- Fixed OpalBandwidth comparison operators. Modified Paths: -------------- opal/trunk/include/opal/mediafmt.h opal/trunk/src/opal/mediafmt.cxx Modified: opal/trunk/include/opal/mediafmt.h =================================================================== --- opal/trunk/include/opal/mediafmt.h 2016-05-12 22:31:54 UTC (rev 34835) +++ opal/trunk/include/opal/mediafmt.h 2016-05-25 03:18:08 UTC (rev 34836) @@ -87,8 +87,9 @@ __inline OpalBandwidth & operator-=(const OpalBandwidth & bw) { m_bps += bw.m_bps; return *this; } __inline OpalBandwidth & operator&=(const OpalBandwidth & bw) { if (m_bps > bw.m_bps) m_bps = bw.m_bps; return *this; } - friend std::ostream & operator<<(std::ostream & strm, const OpalBandwidth & bw); - friend std::istream & operator>>(std::istream & strm, OpalBandwidth & bw); + virtual Comparison Compare(const PObject & other) const; + virtual void PrintOn(std::ostream & strm) const; + virtual void ReadFrom(std::istream & strm); #if OPAL_H323 OpalBandwidth(const H225_BandWidth & bw); Modified: opal/trunk/src/opal/mediafmt.cxx =================================================================== --- opal/trunk/src/opal/mediafmt.cxx 2016-05-12 22:31:54 UTC (rev 34835) +++ opal/trunk/src/opal/mediafmt.cxx 2016-05-25 03:18:08 UTC (rev 34836) @@ -170,32 +170,38 @@ } -std::ostream & operator<<(std::ostream & strm, const OpalBandwidth & bw) +PObject::Comparison OpalBandwidth::Compare(const PObject & other) const { - return strm << PString(PString::ScaleSI, bw.m_bps) << "b/s"; + return Compare2(m_bps, dynamic_cast<const OpalBandwidth &>(other).m_bps); } -std::istream & operator>>(std::istream & strm, OpalBandwidth & bw) +void OpalBandwidth::PrintOn(std::ostream & strm) const { - strm >> bw.m_bps; - if (strm.good()) { - switch (tolower(strm.peek())) { - case 'k' : - bw.m_bps *= 1000; - strm.ignore(1); - break; - case 'm' : - bw.m_bps *= 1000000; - strm.ignore(1); - break; - case 'g' : - bw.m_bps *= 1000000000; - strm.ignore(1); - break; - } + strm << PString(PString::ScaleSI, m_bps) << "b/s"; +} + + +void OpalBandwidth::ReadFrom(std::istream & strm) +{ + strm >> m_bps; + if (!strm.good()) + return; + + switch (tolower(strm.peek())) { + case 'k' : + m_bps *= 1000; + strm.ignore(1); + break; + case 'm' : + m_bps *= 1000000; + strm.ignore(1); + break; + case 'g' : + m_bps *= 1000000000; + strm.ignore(1); + break; } - return strm; } ///////////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cso...@us...> - 2016-05-12 22:31:57
|
Revision: 34835 http://sourceforge.net/p/opalvoip/code/34835 Author: csoutheren Date: 2016-05-12 22:31:54 +0000 (Thu, 12 May 2016) Log Message: ----------- When compiling Opal in-situ, and pkg-config is not installed, say that pkg-config is not installed rather than saying that PTLib is not installed. Modified Paths: -------------- opal/trunk/configure opal/trunk/configure.ac opal/trunk/plugins/configure Modified: opal/trunk/configure =================================================================== --- opal/trunk/configure 2016-05-12 13:33:15 UTC (rev 34834) +++ opal/trunk/configure 2016-05-12 22:31:54 UTC (rev 34835) @@ -5341,18 +5341,18 @@ /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63; int main () @@ -5361,9 +5361,9 @@ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } @@ -5395,33 +5395,33 @@ else ac_cv_type_long_long_int=yes if test "x${ac_cv_prog_cc_c99-no}" = xno; then - ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int - if test $ac_cv_type_long_long_int = yes; then - if test "$cross_compiling" = yes; then : + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> - #ifndef LLONG_MAX - # define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - # define LLONG_MAX (HALF - 1 + HALF) - #endif + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif int main () { long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; ; return 0; } @@ -5435,7 +5435,7 @@ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi + fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 @@ -5458,18 +5458,18 @@ /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63; int main () @@ -5478,9 +5478,9 @@ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } @@ -6603,18 +6603,30 @@ # Check whether --with-ptlib was given. if test "${with_ptlib+set}" = set; then : withval=$with_ptlib; - OPAL_PTLIB_DIR="$withval (--with-ptlib)" - export PKG_CONFIG_PATH=$withval/lib_$target:$withval:$PKG_CONFIG_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: with PTLib at $withval" >&5 + if test "x$PKG_CONFIG" == "x" ; then + as_fn_error $? " + Cannot continue without pkg-config + " "$LINENO" 5 + else + OPAL_PTLIB_DIR="$withval (--with-ptlib)" + export PKG_CONFIG_PATH=$withval/lib_$target:$withval:$PKG_CONFIG_PATH + { $as_echo "$as_me:${as_lineno-$LINENO}: with PTLib at $withval" >&5 $as_echo "$as_me: with PTLib at $withval" >&6;} + fi else if test "x$PTLIBDIR" != "x" ; then - OPAL_PTLIB_DIR="$PTLIBDIR (PTLIBDIR)" - export PKG_CONFIG_PATH=$PTLIBDIR/lib_$target:$PTLIBDIR:$PKG_CONFIG_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: PTLIBDIR environment variable detected as $PTLIBDIR" >&5 + if test "x$PKG_CONFIG" == "x" ; then + as_fn_error $? " + Cannot continue without pkg-config + " "$LINENO" 5 + else + OPAL_PTLIB_DIR="$PTLIBDIR (PTLIBDIR)" + export PKG_CONFIG_PATH=$PTLIBDIR/lib_$target:$PTLIBDIR:$PKG_CONFIG_PATH + { $as_echo "$as_me:${as_lineno-$LINENO}: PTLIBDIR environment variable detected as $PTLIBDIR" >&5 $as_echo "$as_me: PTLIBDIR environment variable detected as $PTLIBDIR" >&6;} + fi fi Modified: opal/trunk/configure.ac =================================================================== --- opal/trunk/configure.ac 2016-05-12 13:33:15 UTC (rev 34834) +++ opal/trunk/configure.ac 2016-05-12 22:31:54 UTC (rev 34835) @@ -103,15 +103,27 @@ ptlib, AS_HELP_STRING([--with-ptlib=<dir>],[location of PTLib]), [ - OPAL_PTLIB_DIR="$withval (--with-ptlib)" - export PKG_CONFIG_PATH=$withval/lib_$target:$withval:$PKG_CONFIG_PATH - AC_MSG_NOTICE(with PTLib at $withval) + if test "x$PKG_CONFIG" == "x" ; then + AC_MSG_ERROR([ + Cannot continue without pkg-config + ]) + else + OPAL_PTLIB_DIR="$withval (--with-ptlib)" + export PKG_CONFIG_PATH=$withval/lib_$target:$withval:$PKG_CONFIG_PATH + AC_MSG_NOTICE(with PTLib at $withval) + fi ], [ if test "x$PTLIBDIR" != "x" ; then - OPAL_PTLIB_DIR="$PTLIBDIR (PTLIBDIR)" - export PKG_CONFIG_PATH=$PTLIBDIR/lib_$target:$PTLIBDIR:$PKG_CONFIG_PATH - AC_MSG_NOTICE(PTLIBDIR environment variable detected as $PTLIBDIR) + if test "x$PKG_CONFIG" == "x" ; then + AC_MSG_ERROR([ + Cannot continue without pkg-config + ]) + else + OPAL_PTLIB_DIR="$PTLIBDIR (PTLIBDIR)" + export PKG_CONFIG_PATH=$PTLIBDIR/lib_$target:$PTLIBDIR:$PKG_CONFIG_PATH + AC_MSG_NOTICE(PTLIBDIR environment variable detected as $PTLIBDIR) + fi fi ] ) Modified: opal/trunk/plugins/configure =================================================================== --- opal/trunk/plugins/configure 2016-05-12 13:33:15 UTC (rev 34834) +++ opal/trunk/plugins/configure 2016-05-12 22:31:54 UTC (rev 34835) @@ -5340,18 +5340,18 @@ /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63; int main () @@ -5360,9 +5360,9 @@ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } @@ -5394,33 +5394,33 @@ else ac_cv_type_long_long_int=yes if test "x${ac_cv_prog_cc_c99-no}" = xno; then - ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int - if test $ac_cv_type_long_long_int = yes; then - if test "$cross_compiling" = yes; then : + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> - #ifndef LLONG_MAX - # define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - # define LLONG_MAX (HALF - 1 + HALF) - #endif + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif int main () { long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; ; return 0; } @@ -5434,7 +5434,7 @@ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi + fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 @@ -5457,18 +5457,18 @@ /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63; int main () @@ -5477,9 +5477,9 @@ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 13:33:18
|
Revision: 34834 http://sourceforge.net/p/opalvoip/code/34834 Author: rjongbloed Date: 2016-05-12 13:33:15 +0000 (Thu, 12 May 2016) Log Message: ----------- Merged revision(s) 34825-34833 from ptlib/branches/v2_16: --------------------- r34827 Fixed trace log display of "base" address:port for UDP socket bundle. --------------------- r34826 Fixed missing virtual causing NAT methods to not be correctly selected by interface. Ultimately causing incorrect media addresses to be included in SDP for SIP. Added the local interface to NAT method PrintOn so appears in trace logs etc. Revision Links: -------------- http://sourceforge.net/p/opalvoip/code/34827 http://sourceforge.net/p/opalvoip/code/34826 Modified Paths: -------------- ptlib/trunk/include/ptclib/pnat.h ptlib/trunk/src/ptclib/pnat.cxx ptlib/trunk/src/ptclib/psockbun.cxx Property Changed: ---------------- ptlib/trunk/ Index: ptlib/trunk =================================================================== --- ptlib/trunk 2016-05-12 10:01:43 UTC (rev 34833) +++ ptlib/trunk 2016-05-12 13:33:15 UTC (rev 34834) Property changes on: ptlib/trunk ___________________________________________________________________ Modified: svn:ignore ## -24,3 +24,4 ## *.sdf ipch .idea +.vs Modified: svn:mergeinfo ## -6,7 +6,7 ## /ptlib/branches/v2_10:25177-29189,32921,32947 /ptlib/branches/v2_12:28485-31603 /ptlib/branches/v2_14:31501-33720 -/ptlib/branches/v2_16:34085-34824 +/ptlib/branches/v2_16:34085-34833 /ptlib/branches/v2_2:20746,20791,20827,22014,22942 /ptlib/branches/v2_4:21086,21094,21147,21160,21185,21281,21296,21305,21322,21337,21363,21467,21471-21472,21506,21508,21623,21695,21744,21746,21763,22241,22958,23045-23046,23061,23066,23712 /ptlib/branches/v2_6:22195,22243,22295,22304,22311,22317,22320,22356,22458,22509,22587,22601-22602,22611,22629,22633,22673,22681,22729,22731-22732,22736,22742,22848,22960,22992,23161,23163,23167,23169,23177,23239,23291,23298,23336,23429,23595,23823,23827,23873,24816 \ No newline at end of property Modified: ptlib/trunk/include/ptclib/pnat.h =================================================================== --- ptlib/trunk/include/ptclib/pnat.h 2016-05-12 10:01:43 UTC (rev 34833) +++ ptlib/trunk/include/ptclib/pnat.h 2016-05-12 13:33:15 UTC (rev 34834) @@ -251,7 +251,7 @@ /**Return the interface NAT router is using. */ - bool GetInterfaceAddress( + virtual bool GetInterfaceAddress( PIPSocket::Address & internalAddress ///< NAT router internal address returned. ) const; Modified: ptlib/trunk/src/ptclib/pnat.cxx =================================================================== --- ptlib/trunk/src/ptclib/pnat.cxx 2016-05-12 10:01:43 UTC (rev 34833) +++ ptlib/trunk/src/ptclib/pnat.cxx 2016-05-12 13:33:15 UTC (rev 34834) @@ -354,14 +354,20 @@ void PNatMethod::PrintOn(ostream & strm) const { strm << GetFriendlyName() << (IsActive() ? " active" : " deactivated"); + PString server = GetServer(); if (!server.IsEmpty()) strm << " server " << server; + if (m_natType != UnknownNat) { strm << " replies " << GetNatTypeName(); if (m_externalAddress.IsValid()) strm << " with address " << m_externalAddress; } + + PIPSocket::Address iface; + if (GetInterfaceAddress(iface)) + strm << " on interface " << iface; } Modified: ptlib/trunk/src/ptclib/psockbun.cxx =================================================================== --- ptlib/trunk/src/ptclib/psockbun.cxx 2016-05-12 10:01:43 UTC (rev 34833) +++ ptlib/trunk/src/ptclib/psockbun.cxx 2016-05-12 13:33:15 UTC (rev 34834) @@ -451,14 +451,17 @@ if (m_natMethods != NULL) { PNatMethod * natMethod = m_natMethods->GetMethod(binding, this); if (natMethod) { - PIPSocket::Address address; - WORD port; - natMethod->GetServerAddress(address, port); - if (PInterfaceMonitor::GetInstance().IsValidBindingForDestination(binding, address)) { + PIPAddressAndPort ap; + natMethod->GetServerAddress(ap); + if (PInterfaceMonitor::GetInstance().IsValidBindingForDestination(binding, ap.GetAddress())) { if (natMethod->CreateSocket(info.socket, binding, m_localPort)) { - info.socket->PUDPSocket::GetLocalAddress(address, port); + PNATUDPSocket * natSocket = dynamic_cast<PNATUDPSocket*>(info.socket); + if (natSocket != NULL) + natSocket->GetBaseAddress(ap); + else + ap.SetAddress(0); PTRACE(4, "Created bundled UDP socket via " << natMethod->GetMethodName() - << ", internal=" << address << ':' << port << ", external=" << info.socket->GetLocalAddress()); + << ", internal=" << ap << ", external=" << info.socket->GetLocalAddress()); return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 10:01:46
|
Revision: 34833 http://sourceforge.net/p/opalvoip/code/34833 Author: rjongbloed Date: 2016-05-12 10:01:43 +0000 (Thu, 12 May 2016) Log Message: ----------- Update version number for beta v3.16.3 Modified Paths: -------------- opal/branches/v3_16/version.h Modified: opal/branches/v3_16/version.h =================================================================== --- opal/branches/v3_16/version.h 2016-05-12 10:01:38 UTC (rev 34832) +++ opal/branches/v3_16/version.h 2016-05-12 10:01:43 UTC (rev 34833) @@ -36,8 +36,8 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 16 -#define BUILD_TYPE ReleaseCode -#define BUILD_NUMBER 2 +#define BUILD_TYPE BetaCode +#define BUILD_NUMBER 3 #endif // _OPAL_VERSION_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 10:01:41
|
Revision: 34832 http://sourceforge.net/p/opalvoip/code/34832 Author: rjongbloed Date: 2016-05-12 10:01:38 +0000 (Thu, 12 May 2016) Log Message: ----------- Tagging v3_16_2 Added Paths: ----------- opal/tags/v3_16_2/ Index: opal/tags/v3_16_2 =================================================================== --- opal/branches/v3_16 2016-05-12 10:01:32 UTC (rev 34831) +++ opal/tags/v3_16_2 2016-05-12 10:01:38 UTC (rev 34832) Property changes on: opal/tags/v3_16_2 ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,25 ## +*.Tags.WW +*.ncb +*.opensdf +*.opt +*.plg +*.sdf +*.suo +Debug +Lib +Release +a.out* +aclocal.m4 +autom4te.cache +bin +config.log +config.status +desktop.ini +doxygen.out +html +ipch +lib* +opal.pc +opal.spec +opal_cfg.dxy +revision.h Added: svn:mergeinfo ## -0,0 +1,19 ## +/opal/branches/Avaya:33962-33963 +/opal/branches/EpsilonEridani:27633,27638,27727,27881-27882,27905,27935,28035,28305,28308,28439,28454,28534,29419,29516,29556,29978,29991,30000,30121-30122,30141,30151,30166,30459,30708,30722,30885,30934-30937,30955,32105,32607 +/opal/branches/Luyten_A:24769-25572 +/opal/branches/ProcyonSpecial:33491-33493,33643 +/opal/branches/Sirius_A:23371,23374,23549,23560,23770 +/opal/branches/Sirius_B:24566,24579,24589,24594,24596,24601,24604,24635-24636,24639-24642,24644,24651,24653,24655-24656,24683,24685,24714-24717,24771,24777-24783,24842,24845,24858,24947,24954-24970,24980,25085 +/opal/branches/autoconf:20594-21001 +/opal/branches/csoutheren/LalandeBranch1:23412-23413,23415,23424,23510,23516,23553,23577,23607,23669,23724,23742-23744,23747-23748,23755,23758,23780,23788,23848,23850,23856 +/opal/branches/rjongbloed/BarnardPlus:20584,20656,20749,20751,20756,20762,20786,20789,20814,20820,20829,20831,20841,20843,20923,20927,20938,22016-22017,22518,22582,22941 +/opal/branches/v3_10:25182-29485,30896,32927-32928,32933 +/opal/branches/v3_12:28489-31709 +/opal/branches/v3_14:31505-33613 +/opal/branches/v3_2:21143,21220,21227,21253,21455 +/opal/branches/v3_4:21060,21062,21088,21092,21111,21113,21115,21119,21143,21148,21151-21152,21155,21158,21184,21188,21253,21265-21266,21283-21284,21298,21300,21303,21307,21309,21311,21327,21331,21333,21359,21367,21369,21488,21556,21564-21565,21568,21570,21620,21625,21631,21748,21751,21756,21759,21761,21767,21770,22246,23044,23140,23143,23286 +/opal/branches/v3_6:22169,22178,22184,22186,22197,22204,22216,22251,22253,22255,22258,22260,22291,22296,22300,22306,22308,22313,22319,22336,22353,22358,22436,22447,22449,22497,22511,22517,22519-22521,22527,22536,22538,22589,22596,22599,22617,22620,22622,22630,22640,22655,22675,22682,22726-22728,22730,22733,22738,22745-22746,22800,22820-22821,22842,22844-22845,22851,22853,22889,22896,22902,22904,22906,22918,22924,22928,22946,22965,22967,22976,22978,22980,22982,22994,23028,23123,23125-23126,23128,23157,23165,23173,23175,23183,23294,23341,23465,23467,23474,23521,23829,24346,24809 +/opal/branches/v3_8:24025,24027,24029,24036,24038,24040,24042,24048,24050,24058,24061,24068,24071,24074,24076,24080,24082,24086-24087,24092,24099,24101,24105,24107,24109,24111,24114,24116-24117,24120-24121,24125,24127,24130,24132,24134,24138,24140,24144,24146,24148,24150-24151,24154,24156,24158,24162,24170,24218,24245,24257,24261,24340,24362-24363,24365,24369,24373,24422,24440,24442,24447,24489,24504,24506,24532,24536,24545,24547,24552,24554,24614,24678,24687,24699,24705,24775,24833,24861,24903,25146 +/opal/trunk:34112-34116,34118-34120,34122,34137-34139,34155-34156,34161-34165,34168,34170,34173,34177,34187-34190,34208,34218,34222,34237-34238,34246-34252,34269-34271,34281-34288,34297,34300,34303-34316,34333,34346,34365,34375,34377,34382-34384,34390,34393-34394,34399,34417-34421,34424,34430,34432,34435-34437,34440,34442,34455-34456,34480,34483-34484,34487-34488,34490-34491,34502-34503,34506,34588-34589,34718,34735,34746,34775,34784,34795 +/ptlib/branches/v2_8:24136 +/ptlib/trunk:20820 \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 10:01:35
|
Revision: 34831 http://sourceforge.net/p/opalvoip/code/34831 Author: rjongbloed Date: 2016-05-12 10:01:32 +0000 (Thu, 12 May 2016) Log Message: ----------- Update release version number to 3.16.2 Modified Paths: -------------- opal/branches/v3_16/version.h Modified: opal/branches/v3_16/version.h =================================================================== --- opal/branches/v3_16/version.h 2016-05-12 09:52:52 UTC (rev 34830) +++ opal/branches/v3_16/version.h 2016-05-12 10:01:32 UTC (rev 34831) @@ -36,7 +36,7 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 16 -#define BUILD_TYPE BetaCode +#define BUILD_TYPE ReleaseCode #define BUILD_NUMBER 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 09:52:54
|
Revision: 34830 http://sourceforge.net/p/opalvoip/code/34830 Author: rjongbloed Date: 2016-05-12 09:52:52 +0000 (Thu, 12 May 2016) Log Message: ----------- Update version number for beta v2.16.3 Modified Paths: -------------- ptlib/branches/v2_16/version.h Modified: ptlib/branches/v2_16/version.h =================================================================== --- ptlib/branches/v2_16/version.h 2016-05-12 09:52:47 UTC (rev 34829) +++ ptlib/branches/v2_16/version.h 2016-05-12 09:52:52 UTC (rev 34830) @@ -35,8 +35,8 @@ #define MAJOR_VERSION 2 #define MINOR_VERSION 16 -#define BUILD_TYPE ReleaseCode -#define BUILD_NUMBER 2 +#define BUILD_TYPE BetaCode +#define BUILD_NUMBER 3 #endif // _PTLib_VERSION_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 09:52:49
|
Revision: 34829 http://sourceforge.net/p/opalvoip/code/34829 Author: rjongbloed Date: 2016-05-12 09:52:47 +0000 (Thu, 12 May 2016) Log Message: ----------- Tagging v2_16_2 Added Paths: ----------- ptlib/tags/v2_16_2/ Index: ptlib/tags/v2_16_2 =================================================================== --- ptlib/branches/v2_16 2016-05-12 09:52:41 UTC (rev 34828) +++ ptlib/tags/v2_16_2 2016-05-12 09:52:47 UTC (rev 34829) Property changes on: ptlib/tags/v2_16_2 ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,27 ## +Lib +Debug +Release +*.suo +*.ncb +*.opt +*.plg +*.Tags.WW +config.log +config.status +a.out* +Makefile +html +bin +lib* +ptlib_cfg.dxy +ptlib.pc +ptlib_debug.pc +autom4te.cache +aclocal.m4 +doxygen.out +revision.h +*.opensdf +*.sdf +ipch +.idea +.vs Added: svn:mergeinfo ## -0,0 +1,13 ## +/opal/branches/v3_6:23595 +/opal/trunk:26179 +/ptlib/branches/EpsilonEridani:27900,27903,28505,30953 +/ptlib/branches/Sirius_B:24839,24844,24968,24982 +/ptlib/branches/csoutheren/LalandeBranch1:23331-23333,23723 +/ptlib/branches/v2_10:25177-29189,32921,32947 +/ptlib/branches/v2_12:28485-31603 +/ptlib/branches/v2_14:31501-33720 +/ptlib/branches/v2_2:20746,20791,20827,22014,22942 +/ptlib/branches/v2_4:21086,21094,21147,21160,21185,21281,21296,21305,21322,21337,21363,21467,21471-21472,21506,21508,21623,21695,21744,21746,21763,22241,22958,23045-23046,23061,23066,23712 +/ptlib/branches/v2_6:22195,22243,22295,22304,22311,22317,22320,22356,22458,22509,22587,22601-22602,22611,22629,22633,22673,22681,22729,22731-22732,22736,22742,22848,22960,22992,23161,23163,23167,23169,23177,23239,23291,23298,23336,23429,23595,23823,23827,23873,24816 +/ptlib/branches/v2_8:24034,24044,24046,24054,24060,24065,24084,24090,24113,24136,24142,24165-24166,24168,24172,24367,24372,24410,24540,24992 +/ptlib/trunk:34109-34115,34121,34140,34142-34143,34146-34149,34152-34154,34169,34171-34172,34180,34182,34184,34194,34219,34221,34231-34232,34244-34245,34254,34267-34268,34280-34284,34298-34315,34335,34344-34345,34347,34354-34356,34366,34379,34398,34405-34411,34418-34423,34493-34508,34581,34584,34722,34740-34745,34774,34792-34793,34796 \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 09:52:43
|
Revision: 34828 http://sourceforge.net/p/opalvoip/code/34828 Author: rjongbloed Date: 2016-05-12 09:52:41 +0000 (Thu, 12 May 2016) Log Message: ----------- Update release version number to 2.16.2 Modified Paths: -------------- ptlib/branches/v2_16/version.h Modified: ptlib/branches/v2_16/version.h =================================================================== --- ptlib/branches/v2_16/version.h 2016-05-12 08:51:21 UTC (rev 34827) +++ ptlib/branches/v2_16/version.h 2016-05-12 09:52:41 UTC (rev 34828) @@ -35,7 +35,7 @@ #define MAJOR_VERSION 2 #define MINOR_VERSION 16 -#define BUILD_TYPE BetaCode +#define BUILD_TYPE ReleaseCode #define BUILD_NUMBER 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rjo...@us...> - 2016-05-12 08:51:23
|
Revision: 34827 http://sourceforge.net/p/opalvoip/code/34827 Author: rjongbloed Date: 2016-05-12 08:51:21 +0000 (Thu, 12 May 2016) Log Message: ----------- Fixed trace log display of "base" address:port for UDP socket bundle. Modified Paths: -------------- ptlib/branches/v2_16/src/ptclib/psockbun.cxx Modified: ptlib/branches/v2_16/src/ptclib/psockbun.cxx =================================================================== --- ptlib/branches/v2_16/src/ptclib/psockbun.cxx 2016-05-12 08:50:51 UTC (rev 34826) +++ ptlib/branches/v2_16/src/ptclib/psockbun.cxx 2016-05-12 08:51:21 UTC (rev 34827) @@ -451,14 +451,17 @@ if (m_natMethods != NULL) { PNatMethod * natMethod = m_natMethods->GetMethod(binding, this); if (natMethod) { - PIPSocket::Address address; - WORD port; - natMethod->GetServerAddress(address, port); - if (PInterfaceMonitor::GetInstance().IsValidBindingForDestination(binding, address)) { + PIPAddressAndPort ap; + natMethod->GetServerAddress(ap); + if (PInterfaceMonitor::GetInstance().IsValidBindingForDestination(binding, ap.GetAddress())) { if (natMethod->CreateSocket(info.socket, binding, m_localPort)) { - info.socket->PUDPSocket::GetLocalAddress(address, port); + PNATUDPSocket * natSocket = dynamic_cast<PNATUDPSocket*>(info.socket); + if (natSocket != NULL) + natSocket->GetBaseAddress(ap); + else + ap.SetAddress(0); PTRACE(4, "Created bundled UDP socket via " << natMethod->GetMethodName() - << ", internal=" << address << ':' << port << ", external=" << info.socket->GetLocalAddress()); + << ", internal=" << ap << ", external=" << info.socket->GetLocalAddress()); return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |