[Pkg-voip-commits] [resiprocate] 03/05: Merge tag 'upstream/1.9.7'
Daniel Pocock
pocock at moszumanska.debian.org
Fri Dec 5 14:45:50 UTC 2014
This is an automated email from the git hooks/post-receive script.
pocock pushed a commit to branch debian-wheezy-backports
in repository resiprocate.
commit 9ead4b05b934c14414b0b5e425dbd76e8e5382d9
Author: Daniel Pocock <daniel at pocock.pro>
Date: Sat May 31 12:49:01 2014 +0200
Merge tag 'upstream/1.9.7'
Upstream version 1.9.7
---
ChangeLog | 20 ++++
configure | 20 ++--
configure.ac | 2 +-
reTurn/AsyncSocketBase.cxx | 1 -
reTurn/AsyncSocketBase.hxx | 8 +-
reTurn/AsyncTcpSocketBase.hxx | 3 +
reTurn/AsyncUdpSocketBase.hxx | 3 +
reTurn/ChannelManager.hxx | 3 +
reTurn/ReTurnConfig.hxx | 3 +
reTurn/RemotePeer.hxx | 3 +
reTurn/StunMessage.cxx | 3 +-
reTurn/StunMessage.hxx | 3 +
reTurn/StunTuple.hxx | 3 +
reTurn/TcpConnection.hxx | 3 +
reTurn/TcpServer.hxx | 3 +
reTurn/TurnAllocation.hxx | 3 +
reTurn/TurnAllocationManager.hxx | 3 +
reTurn/TurnManager.hxx | 3 +
reTurn/TurnPermission.hxx | 3 +
reTurn/UdpRelayServer.hxx | 3 +
reTurn/UdpServer.hxx | 3 +
reTurn/client/TurnAsyncSocket.cxx | 1 -
reTurn/client/TurnAsyncSocket.hxx | 12 ++-
reTurn/client/TurnAsyncSocketHandler.hxx | 3 +
reTurn/client/TurnAsyncTcpSocket.cxx | 1 -
reTurn/client/TurnAsyncTcpSocket.hxx | 4 +
reTurn/client/TurnAsyncTlsSocket.cxx | 1 -
reTurn/client/TurnAsyncTlsSocket.hxx | 1 +
reTurn/client/TurnAsyncUdpSocket.cxx | 1 -
reTurn/client/TurnAsyncUdpSocket.hxx | 4 +
reTurn/client/TurnSocket.cxx | 1 -
reTurn/client/TurnSocket.hxx | 8 +-
reTurn/client/TurnTcpSocket.cxx | 1 -
reTurn/client/TurnTcpSocket.hxx | 4 +
reTurn/client/TurnTlsSocket.cxx | 3 +-
reTurn/client/TurnUdpSocket.cxx | 1 -
reTurn/client/TurnUdpSocket.hxx | 4 +
reTurn/reTurnServer.cxx | 3 +
reflow/Flow.cxx | 4 +
reflow/FlowDtlsSocketContext.cxx | 9 +-
reflow/FlowDtlsSocketContext.hxx | 3 +
reflow/FlowDtlsTimerContext.hxx | 4 +
reflow/FlowManager.cxx | 11 ++-
reflow/MediaStream.cxx | 5 +-
reflow/MediaStream.hxx | 2 +
resip/dum/test/basicClientUserAgent.cxx | 2 +-
resip/recon/ConversationManager.hxx | 6 +-
resip/recon/FlowManagerSipXSocket.cxx | 3 +
resip/recon/RemoteParticipantDialogSet.cxx | 6 --
resip/recon/UserAgent.hxx | 8 +-
resip/recon/readme.txt | 2 +-
resip/stack/HeaderFieldValue.cxx | 12 +++
resip/stack/HeaderFieldValue.hxx | 1 +
resip/stack/ParserContainerBase.cxx | 13 ++-
resip/stack/ParserContainerBase.hxx | 16 +++-
resip/stack/TransactionState.cxx | 21 +++--
resip/stack/TransactionUser.hxx | 2 +
resip/stack/ssl/TlsConnection.cxx | 143 +++++++++++++++++------------
resip/stack/test/testSipMessage.cxx | 37 +++++++-
resiprocate.spec | 7 +-
resiprocate.spec.in | 3 +-
rutil/ConfigParse.cxx | 12 ++-
rutil/GenericIPAddress.hxx | 10 ++
rutil/Log.cxx | 10 +-
rutil/SysLogBuf.cxx | 2 +-
rutil/ssl/OpenSSLInit.cxx | 11 +--
66 files changed, 367 insertions(+), 150 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8fb951a..8a5970e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,24 @@
= Release Notes v 1.9 =
+==1.9.7 Changes==
+rpm: Indicate that b2bua package is obsolete
+resip/stack: TlsConnection: correctly handle OpenSSL error queue after SSL_read
+resip/stack: fix for forced target routing in TransactionState - thanks to John Gregg for this
+rutil: enhance command line parsing exceptions with additional details - thanks to John Gregg for initial contribution
+rutil: if a v6 address is passed to the GenericIPAddress sockaddr constructor, ensure the entire v6 address is copied over properly. Note: sockaddr is smaller than sockaddr_in6 - Thanks to Bjorn A for this fix
+rutil: accept case insensitive log level strings
+resip/dum: fix obscure bug in basicClient where if we don't use a threaded stack processing does not function correctly - required PollGrp to be passed to SipStack constructor
+resip/stack: fix for a use-after-free bug when adding multi-headers to a list that has been copied, and then one of the headers is accessed (but not necessarily parsed) - thanks to Byron Campen for this fix!
+resip/stack: Added accessor for TransactionUser FIFO so to obtain stats
+resip/stack: additional OpenSSL cleanup fn - reordered functions to match order used in this post: http://openssl.6102.n7.nabble.com/Cleanup-procedure-missing-some-calls-td37441.html
+reTurn: modified asio and boost include file ordering to avoid multiply defined symbol errors on linking
+resip/recon: remove extra sleep definitions
+resip/stack: fix a bug with Keepalive processing that causes transaction state leakage and potential traps
+rutil: syslog: use LOG_PID, avoid sending redundant data in log string.
+
+==1.9.6 Changes==
+*resip/recon: fixes a bug that makes it impossible to use codecs with RTP clock rates other than 8000, makes Opus support possible
+*autotools: minor tweaks to reduce warnings during build/linking
+
==1.9.5 Changes==
*resip/recon: do not send DTMF as inband audio, can be troublesome as sipXtapi echoes it back to caller (note: requires latest sipXtapi code with startChannelTone patch)
*resip/recon: SipXHelper: map log entries from sipXtapi to reSIProcate logger
diff --git a/configure b/configure
index 8321d76..2050ea1 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for resiprocate 1.9.6.
+# Generated by GNU Autoconf 2.69 for resiprocate 1.9.7.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='resiprocate'
PACKAGE_TARNAME='resiprocate'
-PACKAGE_VERSION='1.9.6'
-PACKAGE_STRING='resiprocate 1.9.6'
+PACKAGE_VERSION='1.9.7'
+PACKAGE_STRING='resiprocate 1.9.7'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1394,7 +1394,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures resiprocate 1.9.6 to adapt to many kinds of systems.
+\`configure' configures resiprocate 1.9.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1464,7 +1464,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of resiprocate 1.9.6:";;
+ short | recursive ) echo "Configuration of resiprocate 1.9.7:";;
esac
cat <<\_ACEOF
@@ -1600,7 +1600,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-resiprocate configure 1.9.6
+resiprocate configure 1.9.7
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2143,7 +2143,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by resiprocate $as_me 1.9.6, which was
+It was created by resiprocate $as_me 1.9.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2971,7 +2971,7 @@ fi
# Define the identity of the package.
PACKAGE='resiprocate'
- VERSION='1.9.6'
+ VERSION='1.9.7'
cat >>confdefs.h <<_ACEOF
@@ -17677,7 +17677,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by resiprocate $as_me 1.9.6, which was
+This file was extended by resiprocate $as_me 1.9.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17743,7 +17743,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-resiprocate config.status 1.9.6
+resiprocate config.status 1.9.7
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 1ed555c..e162aeb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
-AC_INIT(resiprocate,1.9.6)
+AC_INIT(resiprocate,1.9.7)
AC_CONFIG_SRCDIR(repro/repro.cxx)
SO_RELEASE=`echo $PACKAGE_VERSION | cut -f1,2 -d.`
diff --git a/reTurn/AsyncSocketBase.cxx b/reTurn/AsyncSocketBase.cxx
index 47bcc6f..ff5b6fa 100644
--- a/reTurn/AsyncSocketBase.cxx
+++ b/reTurn/AsyncSocketBase.cxx
@@ -1,6 +1,5 @@
#include "AsyncSocketBase.hxx"
#include "AsyncSocketBaseHandler.hxx"
-#include <boost/bind.hpp>
#include <rutil/WinLeakCheck.hxx>
#include <rutil/Logger.hxx>
#include "ReTurnSubsystem.hxx"
diff --git a/reTurn/AsyncSocketBase.hxx b/reTurn/AsyncSocketBase.hxx
index fc4336b..9e3744f 100644
--- a/reTurn/AsyncSocketBase.hxx
+++ b/reTurn/AsyncSocketBase.hxx
@@ -1,12 +1,16 @@
#ifndef ASYNC_SOCKET_BASE_HXX
#define ASYNC_SOCKET_BASE_HXX
-#include <deque>
#include <asio.hpp>
-#include <boost/bind.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <boost/function.hpp>
+#include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp>
+#include <deque>
+
#include "DataBuffer.hxx"
#include "StunTuple.hxx"
diff --git a/reTurn/AsyncTcpSocketBase.hxx b/reTurn/AsyncTcpSocketBase.hxx
index e0893e8..af91226 100644
--- a/reTurn/AsyncTcpSocketBase.hxx
+++ b/reTurn/AsyncTcpSocketBase.hxx
@@ -2,6 +2,9 @@
#define ASYNC_TCP_SOCKET_BASE_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <boost/bind.hpp>
#include "AsyncSocketBase.hxx"
diff --git a/reTurn/AsyncUdpSocketBase.hxx b/reTurn/AsyncUdpSocketBase.hxx
index c173db0..33e2ce6 100644
--- a/reTurn/AsyncUdpSocketBase.hxx
+++ b/reTurn/AsyncUdpSocketBase.hxx
@@ -2,6 +2,9 @@
#define ASYNC_UDP_SOCKET_BASE_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <boost/bind.hpp>
#include "AsyncSocketBase.hxx"
diff --git a/reTurn/ChannelManager.hxx b/reTurn/ChannelManager.hxx
index 7fff0d7..dc27611 100644
--- a/reTurn/ChannelManager.hxx
+++ b/reTurn/ChannelManager.hxx
@@ -2,6 +2,9 @@
#define CHANNELMANAGER_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "RemotePeer.hxx"
diff --git a/reTurn/ReTurnConfig.hxx b/reTurn/ReTurnConfig.hxx
index a2310ba..ea9d2ad 100644
--- a/reTurn/ReTurnConfig.hxx
+++ b/reTurn/ReTurnConfig.hxx
@@ -3,6 +3,9 @@
#include <map>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <rutil/ConfigParse.hxx>
#include <rutil/Data.hxx>
#include <rutil/Log.hxx>
diff --git a/reTurn/RemotePeer.hxx b/reTurn/RemotePeer.hxx
index 6faab98..1be3ae7 100644
--- a/reTurn/RemotePeer.hxx
+++ b/reTurn/RemotePeer.hxx
@@ -2,6 +2,9 @@
#define REMOTEPEER_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "StunTuple.hxx"
diff --git a/reTurn/StunMessage.cxx b/reTurn/StunMessage.cxx
index e6ff1ae..eed6aa2 100644
--- a/reTurn/StunMessage.cxx
+++ b/reTurn/StunMessage.cxx
@@ -3,6 +3,8 @@
#include "config.h"
#endif
+#include <boost/crc.hpp>
+
#include "StunMessage.hxx"
#include <rutil/compat.hxx>
@@ -10,7 +12,6 @@
#include <rutil/Random.hxx>
#include <rutil/DataStream.hxx>
#include <rutil/MD5Stream.hxx>
-#include <boost/crc.hpp>
#include <rutil/WinLeakCheck.hxx>
#include <rutil/Logger.hxx>
#include "ReTurnSubsystem.hxx"
diff --git a/reTurn/StunMessage.hxx b/reTurn/StunMessage.hxx
index 83828ff..05af18c 100644
--- a/reTurn/StunMessage.hxx
+++ b/reTurn/StunMessage.hxx
@@ -5,6 +5,9 @@
#include <rutil/compat.hxx>
#include <rutil/Data.hxx>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "StunTuple.hxx"
diff --git a/reTurn/StunTuple.hxx b/reTurn/StunTuple.hxx
index 24fc844..d670ff8 100644
--- a/reTurn/StunTuple.hxx
+++ b/reTurn/StunTuple.hxx
@@ -2,6 +2,9 @@
#define STUNTUPLE_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <rutil/resipfaststreams.hxx>
namespace reTurn {
diff --git a/reTurn/TcpConnection.hxx b/reTurn/TcpConnection.hxx
index 8f1c062..1e8ed23 100644
--- a/reTurn/TcpConnection.hxx
+++ b/reTurn/TcpConnection.hxx
@@ -2,6 +2,9 @@
#define TCP_CONNECTION_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <boost/array.hpp>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
diff --git a/reTurn/TcpServer.hxx b/reTurn/TcpServer.hxx
index 68f7df9..d030328 100644
--- a/reTurn/TcpServer.hxx
+++ b/reTurn/TcpServer.hxx
@@ -2,6 +2,9 @@
#define TCP_SERVER_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <string>
#include <boost/noncopyable.hpp>
#include "TcpConnection.hxx"
diff --git a/reTurn/TurnAllocation.hxx b/reTurn/TurnAllocation.hxx
index ad2bf74..6221310 100644
--- a/reTurn/TurnAllocation.hxx
+++ b/reTurn/TurnAllocation.hxx
@@ -4,6 +4,9 @@
#include <map>
#include <boost/noncopyable.hpp>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "StunTuple.hxx"
#include "StunAuth.hxx"
diff --git a/reTurn/TurnAllocationManager.hxx b/reTurn/TurnAllocationManager.hxx
index 62ce09a..d03c1a0 100644
--- a/reTurn/TurnAllocationManager.hxx
+++ b/reTurn/TurnAllocationManager.hxx
@@ -3,6 +3,9 @@
#include <map>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "TurnAllocationKey.hxx"
#include "ReTurnConfig.hxx"
#include "StunTuple.hxx"
diff --git a/reTurn/TurnManager.hxx b/reTurn/TurnManager.hxx
index 3f5e4af..dd95713 100644
--- a/reTurn/TurnManager.hxx
+++ b/reTurn/TurnManager.hxx
@@ -3,6 +3,9 @@
#include <map>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "ReTurnConfig.hxx"
#include "StunTuple.hxx"
diff --git a/reTurn/TurnPermission.hxx b/reTurn/TurnPermission.hxx
index 66bee37..82dcd24 100644
--- a/reTurn/TurnPermission.hxx
+++ b/reTurn/TurnPermission.hxx
@@ -2,6 +2,9 @@
#define TURNPERMISSION_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "StunTuple.hxx"
diff --git a/reTurn/UdpRelayServer.hxx b/reTurn/UdpRelayServer.hxx
index 067b354..e2765ce 100644
--- a/reTurn/UdpRelayServer.hxx
+++ b/reTurn/UdpRelayServer.hxx
@@ -2,6 +2,9 @@
#define UDP_REALY_SERVER_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <string>
#include <boost/noncopyable.hpp>
#include "RequestHandler.hxx"
diff --git a/reTurn/UdpServer.hxx b/reTurn/UdpServer.hxx
index a9fd1f9..1a68f4b 100644
--- a/reTurn/UdpServer.hxx
+++ b/reTurn/UdpServer.hxx
@@ -2,6 +2,9 @@
#define UDP_SERVER_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <string>
#include <boost/noncopyable.hpp>
#include "RequestHandler.hxx"
diff --git a/reTurn/client/TurnAsyncSocket.cxx b/reTurn/client/TurnAsyncSocket.cxx
index d0ce78f..ccde7d6 100644
--- a/reTurn/client/TurnAsyncSocket.cxx
+++ b/reTurn/client/TurnAsyncSocket.cxx
@@ -1,7 +1,6 @@
#include "TurnAsyncSocket.hxx"
#include "../AsyncSocketBase.hxx"
#include "ErrorCode.hxx"
-#include <boost/bind.hpp>
#include <rutil/WinLeakCheck.hxx>
#include <rutil/Logger.hxx>
#include "../ReTurnSubsystem.hxx"
diff --git a/reTurn/client/TurnAsyncSocket.hxx b/reTurn/client/TurnAsyncSocket.hxx
index 5128ead..4002a55 100644
--- a/reTurn/client/TurnAsyncSocket.hxx
+++ b/reTurn/client/TurnAsyncSocket.hxx
@@ -7,12 +7,18 @@
#error You must define ASIO_ENABLE_CANCELIO in your build settings.
#endif
-#include <map>
-#include <queue>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+
#include <rutil/Data.hxx>
#include <rutil/Mutex.hxx>
-#include <boost/function.hpp>
+
+#include <map>
+#include <queue>
#include "reTurn/StunTuple.hxx"
#include "reTurn/StunMessage.hxx"
diff --git a/reTurn/client/TurnAsyncSocketHandler.hxx b/reTurn/client/TurnAsyncSocketHandler.hxx
index 8e75786..8f0a030 100644
--- a/reTurn/client/TurnAsyncSocketHandler.hxx
+++ b/reTurn/client/TurnAsyncSocketHandler.hxx
@@ -3,6 +3,9 @@
#include <rutil/compat.hxx>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include "reTurn/AsyncSocketBaseHandler.hxx"
#include "reTurn/DataBuffer.hxx"
#include "reTurn/StunTuple.hxx"
diff --git a/reTurn/client/TurnAsyncTcpSocket.cxx b/reTurn/client/TurnAsyncTcpSocket.cxx
index 9d427d0..4a0c51a 100644
--- a/reTurn/client/TurnAsyncTcpSocket.cxx
+++ b/reTurn/client/TurnAsyncTcpSocket.cxx
@@ -1,5 +1,4 @@
#include "TurnAsyncTcpSocket.hxx"
-#include <boost/bind.hpp>
// Remove warning about 'this' use in initiator list - pointer is only stored
#if defined(WIN32) && !defined(__GNUC__)
diff --git a/reTurn/client/TurnAsyncTcpSocket.hxx b/reTurn/client/TurnAsyncTcpSocket.hxx
index f6d3eb8..a658935 100644
--- a/reTurn/client/TurnAsyncTcpSocket.hxx
+++ b/reTurn/client/TurnAsyncTcpSocket.hxx
@@ -2,6 +2,10 @@
#define TURNASYNCTCPSOCKET_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+#include <boost/bind.hpp>
#include "TurnAsyncSocket.hxx"
#include "reTurn/AsyncTcpSocketBase.hxx"
diff --git a/reTurn/client/TurnAsyncTlsSocket.cxx b/reTurn/client/TurnAsyncTlsSocket.cxx
index 5172cc4..a11f81e 100644
--- a/reTurn/client/TurnAsyncTlsSocket.cxx
+++ b/reTurn/client/TurnAsyncTlsSocket.cxx
@@ -5,7 +5,6 @@
#ifdef USE_SSL
#include "TurnAsyncTlsSocket.hxx"
-#include <boost/bind.hpp>
using namespace std;
diff --git a/reTurn/client/TurnAsyncTlsSocket.hxx b/reTurn/client/TurnAsyncTlsSocket.hxx
index d5a0a46..b0f3696 100644
--- a/reTurn/client/TurnAsyncTlsSocket.hxx
+++ b/reTurn/client/TurnAsyncTlsSocket.hxx
@@ -9,6 +9,7 @@
#include <asio.hpp>
#include <asio/ssl.hpp>
+#include <boost/bind.hpp>
#include "TurnAsyncTcpSocket.hxx"
#include "reTurn/AsyncTlsSocketBase.hxx"
diff --git a/reTurn/client/TurnAsyncUdpSocket.cxx b/reTurn/client/TurnAsyncUdpSocket.cxx
index 870b848..63772fe 100644
--- a/reTurn/client/TurnAsyncUdpSocket.cxx
+++ b/reTurn/client/TurnAsyncUdpSocket.cxx
@@ -1,5 +1,4 @@
#include "TurnAsyncUdpSocket.hxx"
-#include <boost/bind.hpp>
// Remove warning about 'this' use in initiator list - pointer is only stored
#if defined(WIN32) && !defined(__GNUC__)
diff --git a/reTurn/client/TurnAsyncUdpSocket.hxx b/reTurn/client/TurnAsyncUdpSocket.hxx
index 0ce6894..14aee2f 100644
--- a/reTurn/client/TurnAsyncUdpSocket.hxx
+++ b/reTurn/client/TurnAsyncUdpSocket.hxx
@@ -2,6 +2,10 @@
#define TURNASYNCUDPSOCKET_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+#include <boost/bind.hpp>
#include "TurnAsyncSocket.hxx"
#include "reTurn/AsyncUdpSocketBase.hxx"
diff --git a/reTurn/client/TurnSocket.cxx b/reTurn/client/TurnSocket.cxx
index 155a11a..0d0430e 100644
--- a/reTurn/client/TurnSocket.cxx
+++ b/reTurn/client/TurnSocket.cxx
@@ -1,6 +1,5 @@
#include "TurnSocket.hxx"
#include "ErrorCode.hxx"
-#include <boost/bind.hpp>
#include <rutil/Lock.hxx>
#include <rutil/WinLeakCheck.hxx>
#include <rutil/Logger.hxx>
diff --git a/reTurn/client/TurnSocket.hxx b/reTurn/client/TurnSocket.hxx
index c32f4d2..12383d4 100644
--- a/reTurn/client/TurnSocket.hxx
+++ b/reTurn/client/TurnSocket.hxx
@@ -7,8 +7,14 @@
#error You must define ASIO_ENABLE_CANCELIO in your build settings.
#endif
-#include <vector>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+#include <boost/bind.hpp>
+
+#include <vector>
+
#include <rutil/Data.hxx>
#include <rutil/Mutex.hxx>
diff --git a/reTurn/client/TurnTcpSocket.cxx b/reTurn/client/TurnTcpSocket.cxx
index 8d38bb2..9fc050f 100644
--- a/reTurn/client/TurnTcpSocket.cxx
+++ b/reTurn/client/TurnTcpSocket.cxx
@@ -3,7 +3,6 @@
#endif
#include "TurnTcpSocket.hxx"
-#include <boost/bind.hpp>
#include <rutil/Logger.hxx>
#include "../ReTurnSubsystem.hxx"
diff --git a/reTurn/client/TurnTcpSocket.hxx b/reTurn/client/TurnTcpSocket.hxx
index 4e3822f..9ece62c 100644
--- a/reTurn/client/TurnTcpSocket.hxx
+++ b/reTurn/client/TurnTcpSocket.hxx
@@ -2,6 +2,10 @@
#define TURNTCPSOCKET_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+#include <boost/bind.hpp>
#include "TurnSocket.hxx"
diff --git a/reTurn/client/TurnTlsSocket.cxx b/reTurn/client/TurnTlsSocket.cxx
index ea062a1..23fca51 100644
--- a/reTurn/client/TurnTlsSocket.cxx
+++ b/reTurn/client/TurnTlsSocket.cxx
@@ -4,10 +4,11 @@
#endif
#ifdef USE_SSL
+#include <boost/bind.hpp>
+
#include "TurnTlsSocket.hxx"
#include <openssl/x509.h>
#include <openssl/x509v3.h>
-#include <boost/bind.hpp>
#include <rutil/Logger.hxx>
#include "../ReTurnSubsystem.hxx"
diff --git a/reTurn/client/TurnUdpSocket.cxx b/reTurn/client/TurnUdpSocket.cxx
index a672bcd..c526f9b 100644
--- a/reTurn/client/TurnUdpSocket.cxx
+++ b/reTurn/client/TurnUdpSocket.cxx
@@ -3,7 +3,6 @@
#endif
#include "TurnUdpSocket.hxx"
-#include <boost/bind.hpp>
using namespace std;
diff --git a/reTurn/client/TurnUdpSocket.hxx b/reTurn/client/TurnUdpSocket.hxx
index f9eb132..aeedc2f 100644
--- a/reTurn/client/TurnUdpSocket.hxx
+++ b/reTurn/client/TurnUdpSocket.hxx
@@ -2,6 +2,10 @@
#define TURNUDPSOCKET_HXX
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+#include <boost/bind.hpp>
#include "TurnSocket.hxx"
diff --git a/reTurn/reTurnServer.cxx b/reTurn/reTurnServer.cxx
index 0f91651..efee2d2 100644
--- a/reTurn/reTurnServer.cxx
+++ b/reTurn/reTurnServer.cxx
@@ -2,6 +2,9 @@
#include <csignal>
#include <string>
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/lexical_cast.hpp>
diff --git a/reflow/Flow.cxx b/reflow/Flow.cxx
index f26996a..a9d69b2 100644
--- a/reflow/Flow.cxx
+++ b/reflow/Flow.cxx
@@ -3,7 +3,11 @@
#endif
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <boost/function.hpp>
+
#include <rutil/Log.hxx>
#include <rutil/Logger.hxx>
#include <rutil/Timer.hxx>
diff --git a/reflow/FlowDtlsSocketContext.cxx b/reflow/FlowDtlsSocketContext.cxx
index 9e731b7..674e4ef 100644
--- a/reflow/FlowDtlsSocketContext.cxx
+++ b/reflow/FlowDtlsSocketContext.cxx
@@ -3,14 +3,15 @@
#endif
#ifdef USE_SSL
-#include <rutil/Log.hxx>
-#include <rutil/Logger.hxx>
-#include <rutil/Timer.hxx>
-
#include <asio.hpp>
+#include <asio/ssl.hpp>
#include <boost/function.hpp>
#include <iostream>
+#include <rutil/Log.hxx>
+#include <rutil/Logger.hxx>
+#include <rutil/Timer.hxx>
+
#include "FlowDtlsSocketContext.hxx"
#include "FlowManagerSubsystem.hxx"
diff --git a/reflow/FlowDtlsSocketContext.hxx b/reflow/FlowDtlsSocketContext.hxx
index 9e146ba..2c4fde5 100644
--- a/reflow/FlowDtlsSocketContext.hxx
+++ b/reflow/FlowDtlsSocketContext.hxx
@@ -6,6 +6,9 @@
#define FlowDtlsSocketContext_hxx
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#ifdef WIN32
#include <srtp.h>
#else
diff --git a/reflow/FlowDtlsTimerContext.hxx b/reflow/FlowDtlsTimerContext.hxx
index f8ccc7c..f0f22b7 100644
--- a/reflow/FlowDtlsTimerContext.hxx
+++ b/reflow/FlowDtlsTimerContext.hxx
@@ -2,6 +2,10 @@
#define FlowDtlsTimerContext_hxx
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+
#include <rutil/SharedPtr.hxx>
#include "dtls_wrapper/DtlsTimer.hxx"
diff --git a/reflow/FlowManager.cxx b/reflow/FlowManager.cxx
index c7351ff..5577a61 100644
--- a/reflow/FlowManager.cxx
+++ b/reflow/FlowManager.cxx
@@ -2,6 +2,13 @@
#include "config.h"
#endif
+#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
+#include <boost/function.hpp>
+#include <map>
+
#include <rutil/Log.hxx>
#include <rutil/Logger.hxx>
#include <rutil/ThreadIf.hxx>
@@ -9,10 +16,6 @@
#include <rutil/SharedPtr.hxx>
#include <rutil/Timer.hxx>
-#include <asio.hpp>
-#include <boost/function.hpp>
-#include <map>
-
#ifdef WIN32
#include <srtp.h>
#else
diff --git a/reflow/MediaStream.cxx b/reflow/MediaStream.cxx
index 0a4c2ac..55dd04a 100644
--- a/reflow/MediaStream.cxx
+++ b/reflow/MediaStream.cxx
@@ -2,13 +2,16 @@
#include "config.h"
#endif
+#include <boost/function.hpp>
+
#include <rutil/Log.hxx>
#include <rutil/Logger.hxx>
#include <rutil/Timer.hxx>
+#include "MediaStream.hxx"
#include "FlowManagerSubsystem.hxx"
#include "FlowManager.hxx"
-#include "MediaStream.hxx"
+
using namespace flowmanager;
#ifdef USE_SSL
diff --git a/reflow/MediaStream.hxx b/reflow/MediaStream.hxx
index 498b0a4..80db32f 100644
--- a/reflow/MediaStream.hxx
+++ b/reflow/MediaStream.hxx
@@ -6,7 +6,9 @@
#endif
#include <asio.hpp>
+#ifdef USE_SSL
#include <asio/ssl.hpp>
+#endif
#ifdef WIN32
#include <srtp.h>
#else
diff --git a/resip/dum/test/basicClientUserAgent.cxx b/resip/dum/test/basicClientUserAgent.cxx
index 0f86c68..53e05cc 100644
--- a/resip/dum/test/basicClientUserAgent.cxx
+++ b/resip/dum/test/basicClientUserAgent.cxx
@@ -121,7 +121,7 @@ BasicClientUserAgent::BasicClientUserAgent(int argc, char** argv) :
#endif
mPollGrp(FdPollGrp::create()), // Will create EPoll implementation if available, otherwise FdPoll
mInterruptor(new EventThreadInterruptor(*mPollGrp)),
- mStack(new SipStack(mSecurity, DnsStub::EmptyNameserverList, mInterruptor)),
+ mStack(new SipStack(mSecurity, DnsStub::EmptyNameserverList, mInterruptor, false, 0, 0, mPollGrp)),
mStackThread(new EventStackThread(*mStack, *mInterruptor, *mPollGrp)),
mDum(new DialogUsageManager(*mStack)),
mDumShutdownRequested(false),
diff --git a/resip/recon/ConversationManager.hxx b/resip/recon/ConversationManager.hxx
index e9a6b18..a22812a 100644
--- a/resip/recon/ConversationManager.hxx
+++ b/resip/recon/ConversationManager.hxx
@@ -1,11 +1,7 @@
#if !defined(ConversationManager_hxx)
#define ConversationManager_hxx
-#ifdef WIN32
-#define BOOST__STDC_CONSTANT_MACROS_DEFINED // elminate duplicate define warnings under windows
-#include <stdint.h> // Use Visual Studio's stdint.h
-#define _MSC_STDINT_H_ // This define will ensure that stdint.h in sipXport tree is not used
-#endif
+#include <boost/function.hpp>
#include "BridgeMixer.hxx"
diff --git a/resip/recon/FlowManagerSipXSocket.cxx b/resip/recon/FlowManagerSipXSocket.cxx
index bed4bce..dae4462 100644
--- a/resip/recon/FlowManagerSipXSocket.cxx
+++ b/resip/recon/FlowManagerSipXSocket.cxx
@@ -1,4 +1,7 @@
#include <asio.hpp>
+#ifdef USE_SSL
+#include <asio/ssl.hpp>
+#endif
#include <boost/function.hpp>
#include <rutil/Data.hxx>
diff --git a/resip/recon/RemoteParticipantDialogSet.cxx b/resip/recon/RemoteParticipantDialogSet.cxx
index 2e4cc4c..70b8331 100644
--- a/resip/recon/RemoteParticipantDialogSet.cxx
+++ b/resip/recon/RemoteParticipantDialogSet.cxx
@@ -37,12 +37,6 @@
//#define DISABLE_FLOWMANAGER_IF_NO_NAT_TRAVERSAL
#include <rutil/WinLeakCheck.hxx>
-#ifdef WIN32
- #define sleepMs(t) Sleep(t)
-#else
- #define sleepMs(t) usleep(t*1000)
-#endif
-
using namespace recon;
using namespace resip;
using namespace std;
diff --git a/resip/recon/UserAgent.hxx b/resip/recon/UserAgent.hxx
index 3d08d9d..c39ca5c 100644
--- a/resip/recon/UserAgent.hxx
+++ b/resip/recon/UserAgent.hxx
@@ -1,6 +1,8 @@
#if !defined(UserAgent_hxx)
#define UserAgent_hxx
+#include <boost/function.hpp>
+
#include "ConversationManager.hxx"
#include "ConversationProfile.hxx"
#include "UserAgentMasterProfile.hxx"
@@ -17,12 +19,6 @@
#include <rutil/SharedPtr.hxx>
#include <rutil/Mutex.hxx>
-#ifdef WIN32
- #define sleepMs(t) Sleep(t)
-#else
- #define sleepMs(t) usleep(t*1000)
-#endif
-
namespace recon
{
diff --git a/resip/recon/readme.txt b/resip/recon/readme.txt
index bdf1ec9..b621de3 100644
--- a/resip/recon/readme.txt
+++ b/resip/recon/readme.txt
@@ -103,7 +103,7 @@ Note: Ensure you use at least SVN revision 11413 of sipXtapi.
/resip/ <- https://svn.resiprocate.org/rep/resiprocate/main
/resip/contrib/openssl <- OpenSSL 1.0.1 or above
-/resip/contrib/boost <- BOOST 1.34.1 (required in this location for Windows builds only)
+/resip/contrib/boost <- BOOST 1.34.1 or above (required in this location for Windows builds only)
/sipXtapi <- https://scm.sipfoundry.org/rep/sipX/branches/sipXtapi
Building recon on Windows
diff --git a/resip/stack/HeaderFieldValue.cxx b/resip/stack/HeaderFieldValue.cxx
index e12f31f..69a37ea 100644
--- a/resip/stack/HeaderFieldValue.cxx
+++ b/resip/stack/HeaderFieldValue.cxx
@@ -105,6 +105,18 @@ HeaderFieldValue::HeaderFieldValue(const HeaderFieldValue& hfv, NoOwnershipEnum
// ?bwc? assert(!hfv.mMine); ?
}
+HeaderFieldValue&
+HeaderFieldValue::swap(HeaderFieldValue& orig)
+{
+ if (this != &orig)
+ {
+ std::swap(mField, orig.mField);
+ std::swap(mFieldLength, orig.mFieldLength);
+ std::swap(mMine, orig.mMine);
+ }
+ return *this;
+}
+
HeaderFieldValue::~HeaderFieldValue()
{
if (mMine)
diff --git a/resip/stack/HeaderFieldValue.hxx b/resip/stack/HeaderFieldValue.hxx
index 393e333..6b2efad 100644
--- a/resip/stack/HeaderFieldValue.hxx
+++ b/resip/stack/HeaderFieldValue.hxx
@@ -43,6 +43,7 @@ class HeaderFieldValue
HeaderFieldValue(const HeaderFieldValue& hfv, NoOwnershipEnum);
HeaderFieldValue& operator=(const HeaderFieldValue&);
HeaderFieldValue& copyWithPadding(const HeaderFieldValue& rhs);
+ HeaderFieldValue& swap(HeaderFieldValue& orig);
~HeaderFieldValue();
diff --git a/resip/stack/ParserContainerBase.cxx b/resip/stack/ParserContainerBase.cxx
index 8b5f4ee..f1a3e29 100644
--- a/resip/stack/ParserContainerBase.cxx
+++ b/resip/stack/ParserContainerBase.cxx
@@ -154,11 +154,18 @@ ParserContainerBase::copyParsers(const Parsers& parsers)
mParsers.reserve(mParsers.size() + parsers.size());
for(Parsers::const_iterator p=parsers.begin(); p!=parsers.end(); ++p)
{
- mParsers.push_back(*p);
+ // Copy c'tor and assignment operator for HeaderKit are actually poor
+ // man's move semantics, so we have to implement real copy semantics here.
+ mParsers.push_back(HeaderKit::Empty);
+
HeaderKit& kit(mParsers.back());
- if(kit.pc)
+ if(p->pc)
+ {
+ kit.pc = makeParser(*(p->pc));
+ }
+ else
{
- kit.pc = makeParser(*kit.pc);
+ kit.hfv = p->hfv;
}
}
}
diff --git a/resip/stack/ParserContainerBase.hxx b/resip/stack/ParserContainerBase.hxx
index 805491e..be6ed15 100644
--- a/resip/stack/ParserContainerBase.hxx
+++ b/resip/stack/ParserContainerBase.hxx
@@ -133,17 +133,25 @@ class ParserContainerBase
static const HeaderKit Empty;
HeaderKit(): pc(0){}
+
+ // Poor man's move c'tor, watch out!
HeaderKit(const HeaderKit& orig)
: pc(orig.pc),
hfv(orig.hfv)
- {}
-
+ {
+ HeaderKit& nc_orig = const_cast<HeaderKit&>(orig);
+ std::swap(nc_orig.pc, pc);
+ hfv.swap(nc_orig.hfv);
+ }
+
+ // Poor man's move semantics, watch out!
HeaderKit& operator=(const HeaderKit& rhs)
{
if(this!=&rhs)
{
- pc=rhs.pc;
- hfv=rhs.hfv;
+ HeaderKit& nc_orig = const_cast<HeaderKit&>(rhs);
+ std::swap(nc_orig.pc, pc);
+ hfv.swap(nc_orig.hfv);
}
return *this;
}
diff --git a/resip/stack/TransactionState.cxx b/resip/stack/TransactionState.cxx
index b3cbdab..bef1dcd 100644
--- a/resip/stack/TransactionState.cxx
+++ b/resip/stack/TransactionState.cxx
@@ -397,17 +397,18 @@ TransactionState::processSipMessageAsNew(SipMessage* sip, TransactionController&
void
TransactionState::process(TransactionController& controller,
TransactionMessage* message)
-{
+{
+ // Note: KeepAliveMessage is a special SipMessage - check for it first
+ KeepAliveMessage* keepAlive = dynamic_cast<KeepAliveMessage*>(message);
+ if (keepAlive)
{
- KeepAliveMessage* keepAlive = dynamic_cast<KeepAliveMessage*>(message);
- if (keepAlive)
- {
- StackLog ( << "Sending keep alive to: " << keepAlive->getDestination());
- controller.mTransportSelector.transmit(keepAlive, keepAlive->getDestination());
- delete keepAlive;
- return;
- }
+ StackLog ( << "Sending keep alive to: " << keepAlive->getDestination());
+ controller.mTransportSelector.transmit(keepAlive, keepAlive->getDestination());
+ delete keepAlive;
+ return;
+ }
+ {
ConnectionTerminated* term = dynamic_cast<ConnectionTerminated*>(message);
if (term)
{
@@ -2548,7 +2549,7 @@ TransactionState::sendCurrentToWire()
StackLog(<<"!ah! response with force target going to : "<<target);
transmitState=mController.mTransportSelector.transmit(
sip,
- mTarget,
+ target,
mIsReliable ? 0 : &mMsgToRetransmit);
}
else
diff --git a/resip/stack/TransactionUser.hxx b/resip/stack/TransactionUser.hxx
index e40a2bf..1c534e6 100644
--- a/resip/stack/TransactionUser.hxx
+++ b/resip/stack/TransactionUser.hxx
@@ -136,6 +136,8 @@ class TransactionUser
mCongestionManager->registerFifo(&mFifo);
}
}
+
+ const TimeLimitFifo<Message>* getFifo() { return(&mFifo); } const
virtual UInt16 getExpectedWait() const
{
diff --git a/resip/stack/ssl/TlsConnection.cxx b/resip/stack/ssl/TlsConnection.cxx
index 79d1f6d..c3537aa 100644
--- a/resip/stack/ssl/TlsConnection.cxx
+++ b/resip/stack/ssl/TlsConnection.cxx
@@ -25,6 +25,34 @@ using namespace resip;
#define RESIPROCATE_SUBSYSTEM Subsystem::TRANSPORT
+inline bool handleOpenSSLErrorQueue(int ret, unsigned long err, const char* op)
+{
+ bool hadReason = false;
+ while (true)
+ {
+ const char* file;
+ int line;
+
+ unsigned long code = ERR_get_error_line(&file,&line);
+ if ( code == 0 )
+ {
+ break;
+ }
+
+ char buf[256];
+ ERR_error_string_n(code,buf,sizeof(buf));
+ ErrLog( << buf );
+ DebugLog( << "Error code = " << code << " file=" << file << " line=" << line );
+ hadReason = true;
+ }
+ ErrLog( << "Got TLS " << op << " error=" << err << " ret=" << ret );
+ if(!hadReason)
+ {
+ WarningLog(<<"no reason found with ERR_get_error_line");
+ }
+ return hadReason;
+}
+
TlsConnection::TlsConnection( Transport* transport, const Tuple& tuple,
Socket fd, Security* security,
bool server, Data domain, SecurityTypes::SSLType sslType ,
@@ -109,7 +137,27 @@ TlsConnection::TlsConnection( Transport* transport, const Tuple& tuple,
TlsConnection::~TlsConnection()
{
#if defined(USE_SSL)
- SSL_shutdown(mSsl);
+ ERR_clear_error();
+ int ret = SSL_shutdown(mSsl);
+ if(ret < 0)
+ {
+ int err = SSL_get_error(mSsl, ret);
+ switch (err)
+ {
+ case SSL_ERROR_WANT_READ:
+ case SSL_ERROR_WANT_WRITE:
+ case SSL_ERROR_NONE:
+ {
+ // WANT_READ or WANT_WRITE can arise for bi-directional shutdown on
+ // non-blocking sockets, safe to ignore
+ StackLog( << "Got TLS shutdown error condition of " << err );
+ }
+ break;
+ default:
+ ErrLog(<<"Unexpected error in SSL_shutdown");
+ handleOpenSSLErrorQueue(ret, err, "SSL_shutdown");
+ }
+ }
SSL_free(mSsl);
#endif // USE_SSL
}
@@ -267,29 +315,7 @@ TlsConnection::checkState()
DebugLog(<<"unrecognised/unhandled SSL_get_error result: " << err);
}
ErrLog( << "TLS handshake failed ");
- bool hadReason = false;
- while (true)
- {
- const char* file;
- int line;
-
- unsigned long code = ERR_get_error_line(&file,&line);
- if ( code == 0 )
- {
- break;
- }
-
- char buf[256];
- ERR_error_string_n(code,buf,sizeof(buf));
- ErrLog( << buf );
- ErrLog( << "Error code = "
- << code << " file=" << file << " line=" << line );
- hadReason = true;
- }
- if(!hadReason)
- {
- WarningLog(<<"no reason found with ERR_get_error_line");
- }
+ handleOpenSSLErrorQueue(ok, err, "SSL_do_handshake");
mBio = NULL;
mTlsState = Broken;
return mTlsState;
@@ -372,29 +398,37 @@ TlsConnection::read(char* buf, int count )
int bytesRead = SSL_read(mSsl,buf,count);
StackLog(<< "SSL_read returned " << bytesRead << " bytes [" << Data(Data::Borrow, buf, (bytesRead > 0)?(bytesRead):(0)) << "]");
- int bytesPending = SSL_pending(mSsl);
-
- if ((bytesRead > 0) && (bytesPending > 0))
+ if (bytesRead > 0)
{
- char* buffer = getWriteBufferForExtraBytes(bytesPending);
- if (buffer)
+ int bytesPending = SSL_pending(mSsl);
+ if (bytesPending > 0)
{
- StackLog(<< "reading remaining buffered bytes");
- bytesPending = SSL_read(mSsl, buffer, bytesPending);
- StackLog(<< "SSL_read returned " << bytesPending << " bytes [" << Data(Data::Borrow, buffer, (bytesPending > 0)?(bytesPending):(0)) << "]");
-
- if (bytesPending > 0)
+ char* buffer = getWriteBufferForExtraBytes(bytesPending);
+ if (buffer)
{
- bytesRead += bytesPending;
+ StackLog(<< "reading remaining buffered bytes");
+ bytesPending = SSL_read(mSsl, buffer, bytesPending);
+ StackLog(<< "SSL_read returned " << bytesPending << " bytes [" << Data(Data::Borrow, buffer, (bytesPending > 0)?(bytesPending):(0)) << "]");
+
+ if (bytesPending > 0)
+ {
+ bytesRead += bytesPending;
+ }
+ else
+ {
+ bytesRead = bytesPending;
+ }
}
else
{
- bytesRead = bytesPending;
+ assert(0);
}
}
- else
+ else if (bytesPending < 0)
{
- assert(0);
+ int err = SSL_get_error(mSsl, bytesPending);
+ handleOpenSSLErrorQueue(bytesPending, err, "SSL_pending");
+ return -1;
}
}
@@ -413,9 +447,11 @@ TlsConnection::read(char* buf, int count )
break;
default:
{
- char buf[256];
- ERR_error_string_n(err,buf,sizeof(buf));
- ErrLog( << "Got TLS read ret=" << bytesRead << " error=" << err << " " << buf << (err==5?" - intermediate certificates may be missing from local PEM file" : "") );
+ handleOpenSSLErrorQueue(bytesRead, err, "SSL_read");
+ if(err == 5)
+ {
+ WarningLog(<<"err=5 sometimes indicates that intermediate certificates may be missing from local PEM file");
+ }
return -1;
}
break;
@@ -498,23 +534,7 @@ TlsConnection::write( const char* buf, int count )
break;
default:
{
- while (true)
- {
- const char* file;
- int line;
-
- unsigned long code = ERR_get_error_line(&file,&line);
- if ( code == 0 )
- {
- break;
- }
-
- char buf[256];
- ERR_error_string_n(code,buf,sizeof(buf));
- ErrLog( << buf );
- DebugLog( << "Error code = " << code << " file=" << file << " line=" << line );
- }
- ErrLog( << "Got TLS write error=" << err << " ret=" << ret );
+ handleOpenSSLErrorQueue(ret, err, "SSL_write");
return -1;
}
break;
@@ -563,6 +583,13 @@ TlsConnection::isGood() // has data that can be read
}
int mode = SSL_get_shutdown(mSsl);
+ if ( mode < 0 )
+ {
+ int err = SSL_get_error(mSsl, mode);
+ handleOpenSSLErrorQueue(mode, err, "SSL_get_shutdown");
+ return false;
+ }
+
if ( mode != 0 )
{
return false;
diff --git a/resip/stack/test/testSipMessage.cxx b/resip/stack/test/testSipMessage.cxx
index b673f35..557dd56 100644
--- a/resip/stack/test/testSipMessage.cxx
+++ b/resip/stack/test/testSipMessage.cxx
@@ -28,6 +28,42 @@ int
main(int argc, char** argv)
{
Log::initialize(Log::Cout, Log::Debug, argv[0]);
+ initNetwork();
+
+ {
+ // This test excercises a now fixed use-after-free bug when adding multi-headers to a list that has been copied, and then
+ // one of the headers is accessed (but not necessarily parsed).
+ Data txt("INVITE sip:192.168.2.92:5100;q=1 SIP/2.0\r\n"
+ "Record-Route: <sip:rruser at rrdomain;lr>\r\n"
+ "To: <sip:yiwen_AT_meet2talk.com at whistler.gloo.net>\r\n"
+ "From: Jason Fischl<sip:jason_AT_meet2talk.com at whistler.gloo.net>;tag=ba1aee2d\r\n"
+ "Via: SIP/2.0/UDP 192.168.2.220:5060;branch=z9hG4bK-c87542-da4d3e6a.0-1--c87542-;rport=5060;received=192.168.2.220;stid=579667358\r\n"
+ "Via: SIP/2.0/UDP 192.168.2.15:5100;branch=z9hG4bK-c87542-579667358-1--c87542-;rport=5100;received=192.168.2.15\r\n"
+ "Call-ID: 6c64b42fce01b007\r\n"
+ "CSeq: 2 INVITE\r\n"
+ "Route: <sip:proxy at 192.168.2.220:5060;lr>\r\n"
+ "Contact: <sip:192.168.2.15:5100>\r\n"
+ "Content-Length: 0\r\n"
+ "\r\n");
+
+ auto_ptr<SipMessage> msg(SipMessage::make(txt, true /* isExternal */));
+
+ SipMessage response;
+ Helper::makeResponse(response, *msg, 200);
+
+ // Trigger a parse of Record-Route
+ NameAddr rr("sip:test at rr.com");
+ if(!(response.header(h_RecordRoutes).front() == rr))
+ {
+ //
+ }
+ // Now push a new Record-Route
+ response.header(h_RecordRoutes).push_front(rr);
+ assert(response.header(h_RecordRoutes).back().uri().user() == "rruser");
+
+ //InfoLog(<< response);
+ }
+
static ExtensionParameter p_tag_ext("tag");
{
Data txt(
@@ -44,7 +80,6 @@ main(int argc, char** argv)
"Content-Length: 0\r\n"
"\r\n"
);
- initNetwork();
auto_ptr<SipMessage> msg(TestSupport::makeMessage(txt));
assert(msg.get());
diff --git a/resiprocate.spec b/resiprocate.spec
index 6d54388..4c9fe8e 100644
--- a/resiprocate.spec
+++ b/resiprocate.spec
@@ -1,5 +1,5 @@
Name: resiprocate
-Version: 1.9.6
+Version: 1.9.7
Release: 1%{?dist}
Summary: SIP and TURN stacks, with SIP proxy and TURN server implementations
License: VSL
@@ -35,6 +35,7 @@ Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
+Obsoletes: resiprocate-b2bua
%description
The reSIProcate components, particularly the SIP stack, are in use in both
@@ -131,7 +132,7 @@ PYVERSION=2.7
%endif
PYCONFIG=/usr/bin/python${PYVERSION}-config
export LDFLAGS="${LDFLAGS} -L%{_libdir}/mysql -L%{_libdir}/libdb4"
-CXXFLAGS="%{optflags} -I%{_includedir}/libdb4" %configure --with-c-ares --with-ssl --with-mysql --with-radius --with-repro --enable-repro-plugins --with-apps --enable-ipv6 --enable-dtls --with-python DEPS_PYTHON_CFLAGS="`${PYCONFIG} --cflags`" DEPS_PYTHON_LIBS="`${PYCONFIG} --ldflags`" PYCXX_SRCDIR=/usr/src/CXX/Python2
+CXXFLAGS="%{optflags} -I%{_includedir}/libdb4 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS" %configure --with-c-ares --with-ssl --with-mysql --with-radius --with-repro --enable-repro-plugins --with-apps --enable-ipv6 --enable-dtls --with-python DEPS_PYTHON_CFLAGS="`${PYCONFIG} --cflags`" DEPS_PYTHON_LIBS="`${PYCONFIG} --ldflags`" PYCXX_SRCDIR=/usr/src/CXX/Python2
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
@@ -367,7 +368,7 @@ rm -rf $RPM_BUILD_ROOT
%{_sbindir}/presSvr
%changelog
-* Sat Nov 24 2012 Daniel Pocock <daniel at pocock.com.au> - 1.9.6-1
+* Sat Nov 24 2012 Daniel Pocock <daniel at pocock.com.au> - 1.9.7-1
- Produce multiple packages for stack/libs, daemons, sipdialer
- Initial build based on autotools
diff --git a/resiprocate.spec.in b/resiprocate.spec.in
index dec4c8c..81a096e 100644
--- a/resiprocate.spec.in
+++ b/resiprocate.spec.in
@@ -35,6 +35,7 @@ Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
+Obsoletes: resiprocate-b2bua
%description
The reSIProcate components, particularly the SIP stack, are in use in both
@@ -131,7 +132,7 @@ PYVERSION=2.7
%endif
PYCONFIG=/usr/bin/python${PYVERSION}-config
export LDFLAGS="${LDFLAGS} -L%{_libdir}/mysql -L%{_libdir}/libdb4"
-CXXFLAGS="%{optflags} -I%{_includedir}/libdb4" %configure --with-c-ares --with-ssl --with-mysql --with-radius --with-repro --enable-repro-plugins --with-apps --enable-ipv6 --enable-dtls --with-python DEPS_PYTHON_CFLAGS="`${PYCONFIG} --cflags`" DEPS_PYTHON_LIBS="`${PYCONFIG} --ldflags`" PYCXX_SRCDIR=/usr/src/CXX/Python2
+CXXFLAGS="%{optflags} -I%{_includedir}/libdb4 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS" %configure --with-c-ares --with-ssl --with-mysql --with-radius --with-repro --enable-repro-plugins --with-apps --enable-ipv6 --enable-dtls --with-python DEPS_PYTHON_CFLAGS="`${PYCONFIG} --cflags`" DEPS_PYTHON_LIBS="`${PYCONFIG} --ldflags`" PYCXX_SRCDIR=/usr/src/CXX/Python2
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
diff --git a/rutil/ConfigParse.cxx b/rutil/ConfigParse.cxx
index 4fca6ca..3cfb097 100644
--- a/rutil/ConfigParse.cxx
+++ b/rutil/ConfigParse.cxx
@@ -117,13 +117,16 @@ ConfigParse::parseCommandLine(int argc, char** argv, int skipCount)
{
cerr << "Invalid command line parameters:" << endl;
cerr << " Name/Value pairs must contain an = or a : between the name and the value" << endl;
- throw Exception("Name/Value pairs must contain an = or a : between the name and the value", __FILE__, __LINE__);
+ cerr << " Bad argument: " << argData << endl;
+ Data exceptionString("Name/Value pairs must contain an = or a : between the name and the value (Bad argument: " + argData + ")");
+ throw Exception(exceptionString, __FILE__, __LINE__);
}
}
catch(BaseException& ex)
{
cerr << "Invalid command line parameters:" << endl;
cerr << " Exception parsing Name/Value pairs: " << ex << endl;
+ cerr << " Bad argument: " << argData << endl;
throw;
}
}
@@ -131,7 +134,9 @@ ConfigParse::parseCommandLine(int argc, char** argv, int skipCount)
{
cerr << "Invalid command line parameters:" << endl;
cerr << " Name/Value pairs must be prefixed with either a -, --, or a /" << endl;
- throw Exception("Name/Value pairs must be prefixed with either a -, --, or a /", __FILE__, __LINE__);
+ cerr << " Bad argument: " << argData << endl;
+ Data exceptionString("Name/Value pairs must be prefixed with either a -, --, or a / (Bad argument: " + argData + ")");
+ throw Exception(exceptionString, __FILE__, __LINE__);
}
}
}
@@ -153,7 +158,8 @@ ConfigParse::parseConfigFile(const Data& filename)
if(!configFile)
{
- throw Exception("Error opening/reading configuration file", __FILE__, __LINE__);
+ Data exceptionString("Error opening/reading configuration file: " + filename);
+ throw Exception(exceptionString, __FILE__, __LINE__);
}
string sline;
diff --git a/rutil/GenericIPAddress.hxx b/rutil/GenericIPAddress.hxx
index d5b95c2..eb30a85 100644
--- a/rutil/GenericIPAddress.hxx
+++ b/rutil/GenericIPAddress.hxx
@@ -28,6 +28,16 @@ struct GenericIPAddress
GenericIPAddress(const sockaddr& addr) : address(addr)
{
+#ifdef IPPROTO_IPV6
+ if (addr.sa_family == AF_INET6)
+ {
+ v6Address = reinterpret_cast<const sockaddr_in6&>(addr);
+ }
+ else
+#endif
+ {
+ v4Address = reinterpret_cast<const sockaddr_in&>(addr);
+ }
}
GenericIPAddress(const sockaddr_in& v4) : v4Address(v4)
diff --git a/rutil/Log.cxx b/rutil/Log.cxx
index 2bba311..7f85d87 100644
--- a/rutil/Log.cxx
+++ b/rutil/Log.cxx
@@ -300,7 +300,7 @@ Log::toLevel(const Data& l)
int i=0;
while (strlen(mDescriptions[i]))
{
- if (strcmp(pri.c_str(), mDescriptions[i]) == 0)
+ if (isEqualNoCase(pri, Data(mDescriptions[i])))
{
return Level(i-1);
}
@@ -368,12 +368,12 @@ Log::tags(Log::Level level,
#else // #if defined( WIN32 ) || defined( __APPLE__ )
if(resip::Log::getLoggerData().type() == Syslog)
{
- strm << mDescriptions[level+1] << Log::delim
- << timestamp(ts) << Log::delim
+ strm // << mDescriptions[level+1] << Log::delim
+ // << timestamp(ts) << Log::delim
// << mHostname << Log::delim
- << mAppName << Log::delim
+ // << mAppName << Log::delim
<< subsystem << Log::delim
- << mPid << Log::delim
+ // << mPid << Log::delim
<< pthread_self() << Log::delim
<< pfile << ":" << line;
}
diff --git a/rutil/SysLogBuf.cxx b/rutil/SysLogBuf.cxx
index 4a3252d..2072000 100644
--- a/rutil/SysLogBuf.cxx
+++ b/rutil/SysLogBuf.cxx
@@ -16,7 +16,7 @@ SysLogBuf::SysLogBuf ()
{
#if !defined(WIN32)
setp(buffer,buffer+Size);
- openlog (0, LOG_NDELAY, LOG_LOCAL6);
+ openlog (0, LOG_NDELAY | LOG_PID, LOG_LOCAL6);
#endif
}
diff --git a/rutil/ssl/OpenSSLInit.cxx b/rutil/ssl/OpenSSLInit.cxx
index 32ea222..0441f65 100644
--- a/rutil/ssl/OpenSSLInit.cxx
+++ b/rutil/ssl/OpenSSLInit.cxx
@@ -71,13 +71,12 @@ OpenSSLInit::OpenSSLInit()
OpenSSLInit::~OpenSSLInit()
{
mInitialized = false;
- ERR_free_strings();// Clean up data allocated during SSL_load_error_strings
- ERR_remove_state(0);// free thread error queue
- CRYPTO_cleanup_all_ex_data();
- EVP_cleanup();// Clean up data allocated during OpenSSL_add_all_algorithms
+ ERR_remove_state(0);// free thread error queue
+ EVP_cleanup();// Clean up data allocated during OpenSSL_add_all_algorithms
+ CRYPTO_cleanup_all_ex_data();
+ ERR_free_strings();// Clean up data allocated during SSL_load_error_strings
+ sk_SSL_COMP_free (SSL_COMP_get_compression_methods());
- //!dcm! We know we have a leak; see BaseSecurity::~BaseSecurity for
- //!details.
// CRYPTO_mem_leaks_fp(stderr);
delete [] mMutexes;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/resiprocate.git
More information about the Pkg-voip-commits
mailing list