[Pkg-voip-commits] [resiprocate] 01/04: Imported Upstream version 1.9.2
Daniel Pocock
pocock at moszumanska.debian.org
Sun Mar 9 21:18:03 UTC 2014
This is an automated email from the git hooks/post-receive script.
pocock pushed a commit to annotated tag debian/1.9.2-1
in repository resiprocate.
commit 13f491147cee0b51b98da415bd838e260612de7a
Author: Daniel Pocock <daniel at pocock.com.au>
Date: Sun Mar 9 21:06:01 2014 +0100
Imported Upstream version 1.9.2
---
ChangeLog | 19 ++-
configure | 20 +--
configure.ac | 2 +-
resip/stack/BranchParameter.cxx | 25 ++--
resip/stack/test/testParserCategories.cxx | 208 +++++++++++++++++++++---------
resiprocate.spec | 4 +-
rutil/Data.cxx | 2 +-
rutil/ParseBuffer.cxx | 8 ++
rutil/ParseBuffer.hxx | 4 +
rutil/dns/ares/ares_init.c | 25 +++-
10 files changed, 230 insertions(+), 87 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 52f9f57..1a53cb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,25 @@
= Release Notes v 1.9 =
+==1.9.2 Changes==
+*rutil/dns: fix for Windows DNS Server use. Ignore Link Local DNS Server entries.
+*rutil: add extra ParseBuffer constructor for const char*
+*rutil: Data: ust strncmp in comparisons with const char*
==1.9.1 Changes==
-*Placeholder
+*adapt to work with asio v1.10.1 (still works with v1.4.x too)
+*fix for spinning in DnsThread
+*ensure mPollGrp is set before accessing it in AresDnsPollItem::resetPollGrp
+*fix RegSyncClient so that it detects breaks in the socket connection to the server - by using keepalives
+*made EGAIN and EWOULDBLOCK processing the same in a few additional spots
+*add WinLeakCheck header to some new Websocket class files to aid in leak detection on windows
+*stop trying to write cert files in various places
+*repro:
+**WebAdmin: catch and log exceptions when starting
+**fix issue with CommandServerList being deleted when not newed if startup fails due to transport exception
+**fixed up StackStatistics handling for when multiple command servers are running (ie: v4 and v6 CommandServers)
+**ensure we use the ServerText config setting to set the server text headers in requests that traverse repro
+*use threadsafe variant of localtime (localtime_r) on non-windows based platforms
+==1.9.0 Changes since 1.8.0==
==Highlights==
*Session/registration accounting
*SIP over WebSocket support for WebRTC, with cookie authentication option
diff --git a/configure b/configure
index 024a7d9..a5d4d38 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.1.
+# Generated by GNU Autoconf 2.69 for resiprocate 1.9.2.
#
#
# 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.1'
-PACKAGE_STRING='resiprocate 1.9.1'
+PACKAGE_VERSION='1.9.2'
+PACKAGE_STRING='resiprocate 1.9.2'
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.1 to adapt to many kinds of systems.
+\`configure' configures resiprocate 1.9.2 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.1:";;
+ short | recursive ) echo "Configuration of resiprocate 1.9.2:";;
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.1
+resiprocate configure 1.9.2
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.1, which was
+It was created by resiprocate $as_me 1.9.2, 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.1'
+ VERSION='1.9.2'
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.1, which was
+This file was extended by resiprocate $as_me 1.9.2, 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.1
+resiprocate config.status 1.9.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 8e30f19..59161fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
-AC_INIT(resiprocate,1.9.1)
+AC_INIT(resiprocate,1.9.2)
AC_CONFIG_SRCDIR(repro/repro.cxx)
SO_RELEASE=`echo $PACKAGE_VERSION | cut -f1,2 -d.`
diff --git a/resip/stack/BranchParameter.cxx b/resip/stack/BranchParameter.cxx
index 7f6802f..107b2f7 100644
--- a/resip/stack/BranchParameter.cxx
+++ b/resip/stack/BranchParameter.cxx
@@ -35,18 +35,21 @@ BranchParameter::BranchParameter(ParameterTypes::Type type,
pb.skipWhitespace();
pb.skipChar(Symbols::EQUALS[0]);
pb.skipWhitespace();
- if(memcmp(pb.position(), Symbols::MagicCookie, 7) == 0)
+ if (pb.lengthRemaining() >= 7)
{
- mHasMagicCookie=true;
- pb.skipN(7);
- }
- // !bwc! This no-case comparison is expensive; only do it if the case-
- // sensitive comparison fails.
- else if(strncasecmp(pb.position(), Symbols::MagicCookie, 7) == 0)
- {
- mHasMagicCookie=true;
- mInteropMagicCookie = new Data(pb.position(), 7);
- pb.skipN(7);
+ if(memcmp(pb.position(), Symbols::MagicCookie, 7) == 0)
+ {
+ mHasMagicCookie=true;
+ pb.skipN(7);
+ }
+ // !bwc! This no-case comparison is expensive; only do it if the case-
+ // sensitive comparison fails.
+ else if(strncasecmp(pb.position(), Symbols::MagicCookie, 7) == 0)
+ {
+ mHasMagicCookie=true;
+ mInteropMagicCookie = new Data(pb.position(), 7);
+ pb.skipN(7);
+ }
}
const char* start = pb.position();
diff --git a/resip/stack/test/testParserCategories.cxx b/resip/stack/test/testParserCategories.cxx
index 1fb74ff..0b70bf7 100644
--- a/resip/stack/test/testParserCategories.cxx
+++ b/resip/stack/test/testParserCategories.cxx
@@ -54,6 +54,62 @@ class TR
~TR() { end();}
};
+bool failed = false;
+#define ASSERT_EQ(lhs, rhs, desc) \
+{ \
+ if (!((lhs) == (rhs))) \
+ { \
+ std::cerr << __FILE__ << ":" << __LINE__ << " - " << (desc) << " " \
+ << "\"" << (lhs) << "\" ( " << #lhs << " ) != " \
+ << "\"" << (rhs) << "\" ( " << #rhs << " ) " << std::endl; \
+ failed = true; \
+ } \
+}
+
+resip::Data
+toData(const resip::ParserCategory& p)
+{
+ resip::Data result;
+ resip::oDataStream str(result);
+ str << p;
+ return result;
+}
+
+template <class T>
+void testParseAndWrite(const resip::Data& rawInput,
+ const resip::Data& parsedOutput)
+{
+ TR _tr("Test " + rawInput + " <-> " + parsedOutput);
+
+ HeaderFieldValue hfv(rawInput.data(), rawInput.size());
+ T raw(hfv, Headers::UNKNOWN);
+ T rawCopy(raw);
+
+ ASSERT_EQ(toData(raw), rawInput, "pre-parse");
+ ASSERT_EQ(toData(rawCopy), rawInput, "pre-parse");
+
+ raw.isWellFormed();
+ T parsedCopy(raw);
+
+ ASSERT_EQ(toData(raw), rawInput, "post-parse");
+ ASSERT_EQ(toData(parsedCopy), rawInput, "post-parse");
+
+ raw.markDirty();
+ T dirtyCopy(raw);
+
+ ASSERT_EQ(toData(raw), parsedOutput, "dirty");
+ ASSERT_EQ(toData(dirtyCopy), parsedOutput, "dirty");
+
+ raw = rawCopy;
+ ASSERT_EQ(toData(raw), rawInput, "restored to raw");
+
+ rawCopy.isWellFormed();
+ ASSERT_EQ(toData(rawCopy), rawInput, "post-parse");
+ rawCopy.markDirty();
+ ASSERT_EQ(toData(rawCopy), parsedOutput, "dirty");
+}
+
+
int
main(int arc, char** argv)
{
@@ -2215,13 +2271,46 @@ main(int arc, char** argv)
test.value().pop_back();
}
+ testParseAndWrite<NameAddr>("*", "*");
+ testParseAndWrite<NameAddr>(" *", "*");
+ testParseAndWrite<NameAddr>("* ", "*");
+ testParseAndWrite<NameAddr>("* ;foo", "*;foo");
+ testParseAndWrite<NameAddr>("*bob*<sip:bob at foo>", "\"*bob*\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("\"bob\"<sip:bob at foo>", "\"bob\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("bob<sip:bob at foo> ", "\"bob\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("*bob* <sip:bob at foo>", "\"*bob*\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("\"bob\" <sip:bob at foo>", "\"bob\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("bob <sip:bob at foo> ", "\"bob\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("bob < sip:bob at foo> ", "\"bob\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>(" bob<sip:bob at foo>", "\"bob\"<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("sip:bob at foo", "<sip:bob at foo>");
+ testParseAndWrite<NameAddr>("sip:bob at foo;foo", "<sip:bob at foo>;foo");
+ testParseAndWrite<NameAddr>("sip:bob at foo; foo", "<sip:bob at foo>;foo");
+ testParseAndWrite<NameAddr>("sip:bob at foo;foo ", "<sip:bob at foo>;foo");
+
+#ifdef USE_IPV6
+ testParseAndWrite<Via>("SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]", "SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]");
+ testParseAndWrite<Via>("SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5];branch=first", "SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5];branch=first");
+ testParseAndWrite<Via>("SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]:5060;branch=first", "SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]:5060;branch=first");
+ testParseAndWrite<Via>("SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]:5060;branch=z9hG4bK", "SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]:5060;branch=z9hG4bK");
+ testParseAndWrite<Via>("SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]:5060;branch=Z9Hg4Bk", "SIP/2.0/UDP [fe80::5626:96ff:fed5:c1f5]:5060;branch=Z9Hg4Bk");
+#endif
+ testParseAndWrite<Via>("SIP/2.0/UDP biloxi.com", "SIP/2.0/UDP biloxi.com");
+ testParseAndWrite<Via>("SIP/2.0/UDP biloxi.com;branch=first", "SIP/2.0/UDP biloxi.com;branch=first");
+ testParseAndWrite<Via>("sip/2.0/udp biloxi.com:5060;branch=first", "sip/2.0/udp biloxi.com:5060;branch=first");
+ testParseAndWrite<Via>("SIP/2.0/UDP biloxi.com:5060;branch=z9hG4bK", "SIP/2.0/UDP biloxi.com:5060;branch=z9hG4bK");
+ testParseAndWrite<Via>("SIP/2.0/UDP biloxi.com:5060;branch=Z9Hg4Bk", "SIP/2.0/UDP biloxi.com:5060;branch=Z9Hg4Bk");
+ testParseAndWrite<Via>("SIP/2.0/UDP biloxi.com:5060;branch=Z9Hg4Bk-999999-", "SIP/2.0/UDP biloxi.com:5060;branch=Z9Hg4Bk-999999-");
+ testParseAndWrite<Via>("SIP/2.0/UDP biloxi.com:5060;branch=Z9Hg4Bk-524287-11-feedbeef-beefdead-uhoh", "SIP/2.0/UDP biloxi.com:5060;branch=Z9Hg4Bk-524287-11-feedbeef-beefdead-uhoh");
+
// Performance tests
+ // !bwc! Add command-line flag to enable/disable this.
{
resip::Data test("Raw header-field-value creation/deletion");
cout << endl << test << endl;
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
HeaderFieldValue hfv(test.data(), test.size());
// (hfv, Headers::UNKNOWN);
@@ -2235,7 +2324,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Auth auth(hfv, Headers::UNKNOWN);
}
@@ -2247,7 +2336,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Auth auth(hfv, Headers::UNKNOWN);
auth.checkParsed();
@@ -2259,7 +2348,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2273,7 +2362,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Auth auth(hfv, Headers::UNKNOWN);
auth.checkParsed();
@@ -2285,7 +2374,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2300,7 +2389,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
CSeqCategory cseq(hfv, Headers::UNKNOWN);
}
@@ -2312,7 +2401,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
CSeqCategory cseq(hfv, Headers::UNKNOWN);
cseq.checkParsed();
@@ -2324,7 +2413,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2338,7 +2427,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
CSeqCategory cseq(hfv, Headers::UNKNOWN);
cseq.checkParsed();
@@ -2350,7 +2439,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2366,7 +2455,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
CallId callid(hfv, Headers::UNKNOWN);
}
@@ -2378,7 +2467,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
CallId callid(hfv, Headers::UNKNOWN);
callid.checkParsed();
@@ -2390,7 +2479,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2406,7 +2495,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
DateCategory date(hfv, Headers::UNKNOWN);
}
@@ -2418,7 +2507,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
DateCategory date(hfv, Headers::UNKNOWN);
date.checkParsed();
@@ -2430,7 +2519,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2446,7 +2535,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
ExpiresCategory pc(hfv, Headers::UNKNOWN);
}
@@ -2458,7 +2547,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
ExpiresCategory pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2470,7 +2559,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2486,7 +2575,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Mime pc(hfv, Headers::UNKNOWN);
}
@@ -2498,7 +2587,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Mime pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2510,7 +2599,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2524,7 +2613,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Mime pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2536,7 +2625,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2552,7 +2641,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
}
@@ -2564,7 +2653,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2576,7 +2665,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2590,7 +2679,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2602,7 +2691,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2616,7 +2705,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2628,7 +2717,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2644,7 +2733,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2656,7 +2745,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2670,7 +2759,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2682,7 +2771,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2696,7 +2785,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2708,7 +2797,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2722,7 +2811,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
NameAddr pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2734,7 +2823,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2750,7 +2839,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
RequestLine pc(hfv);
}
@@ -2762,7 +2851,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
RequestLine pc(hfv);
pc.checkParsed();
@@ -2774,7 +2863,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2788,7 +2877,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
RequestLine pc(hfv);
pc.checkParsed();
@@ -2800,7 +2889,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2816,7 +2905,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
StatusLine pc(hfv);
}
@@ -2828,7 +2917,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
StatusLine pc(hfv);
pc.checkParsed();
@@ -2840,7 +2929,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2854,7 +2943,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
StatusLine pc(hfv);
pc.checkParsed();
@@ -2866,7 +2955,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2880,7 +2969,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
StatusLine pc(hfv);
pc.checkParsed();
@@ -2892,7 +2981,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2908,7 +2997,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Via pc(hfv, Headers::UNKNOWN);
}
@@ -2920,7 +3009,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Via pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2932,7 +3021,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2947,7 +3036,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Token pc(hfv, Headers::UNKNOWN);
}
@@ -2959,7 +3048,7 @@ main(int arc, char** argv)
cout << endl << test << endl;
HeaderFieldValue hfv(test.data(), test.size());
UInt64 now(Timer::getTimeMicroSec());
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
Token pc(hfv, Headers::UNKNOWN);
pc.checkParsed();
@@ -2971,7 +3060,7 @@ main(int arc, char** argv)
Data buffer;
oDataStream str(buffer);
now=Timer::getTimeMicroSec();
- for(int i=0; i<10000000; ++i)
+ for(int i=0; i<1000; ++i)
{
pc.encode(str);
str.flush();
@@ -2980,6 +3069,8 @@ main(int arc, char** argv)
cout << Timer::getTimeMicroSec() - now << " microseconds" << endl;
}
+
+ assert(!failed);
resipCerr << "\nTEST OK" << endl;
return 0;
@@ -3037,4 +3128,5 @@ main(int arc, char** argv)
/* Local Variables: */
/* c-file-style: "ellemtel" */
+// vim: softtabstop=3 shiftwidth=3 expandtab
/* End: */
diff --git a/resiprocate.spec b/resiprocate.spec
index 421826a..cc13db2 100644
--- a/resiprocate.spec
+++ b/resiprocate.spec
@@ -1,5 +1,5 @@
Name: resiprocate
-Version: 1.9.1
+Version: 1.9.2
Release: 1%{?dist}
Summary: SIP and TURN stacks, with SIP proxy and TURN server implementations
License: VSL
@@ -367,7 +367,7 @@ rm -rf $RPM_BUILD_ROOT
%{_sbindir}/presSvr
%changelog
-* Sat Nov 24 2012 Daniel Pocock <daniel at pocock.com.au> - 1.9.1-1
+* Sat Nov 24 2012 Daniel Pocock <daniel at pocock.com.au> - 1.9.2-1
- Produce multiple packages for stack/libs, daemons, sipdialer
- Initial build based on autotools
diff --git a/rutil/Data.cxx b/rutil/Data.cxx
index 13020c1..1d53e1d 100644
--- a/rutil/Data.cxx
+++ b/rutil/Data.cxx
@@ -719,7 +719,7 @@ bool
resip::operator==(const Data& lhs, const char* rhs)
{
assert(rhs); // .dlb. not consistent with constructor
- if (memcmp(lhs.mBuf, rhs, lhs.mSize) != 0)
+ if (strncmp(lhs.mBuf, rhs, lhs.mSize) != 0)
{
return false;
}
diff --git a/rutil/ParseBuffer.cxx b/rutil/ParseBuffer.cxx
index 5d6398d..ee4a96f 100644
--- a/rutil/ParseBuffer.cxx
+++ b/rutil/ParseBuffer.cxx
@@ -22,6 +22,14 @@ ParseBuffer::ParseBuffer(const char* buff, size_t len,
mErrorContext(errorContext)
{}
+ParseBuffer::ParseBuffer(const char* buff,
+ const Data& errorContext)
+ : mBuff(buff),
+ mPosition(buff),
+ mEnd(buff+strlen(buff)),
+ mErrorContext(errorContext)
+{}
+
ParseBuffer::ParseBuffer(const Data& data,
const Data& errorContext)
: mBuff(data.data()),
diff --git a/rutil/ParseBuffer.hxx b/rutil/ParseBuffer.hxx
index ceb489c..1875357 100644
--- a/rutil/ParseBuffer.hxx
+++ b/rutil/ParseBuffer.hxx
@@ -21,6 +21,9 @@ class ParseBuffer
ParseBuffer(const char* buff, size_t len,
const Data& errorContext = Data::Empty);
+ explicit ParseBuffer(const char* buff,
+ const Data& errorContext = Data::Empty);
+
explicit ParseBuffer(const Data& data,
const Data& errorContext = Data::Empty);
@@ -110,6 +113,7 @@ class ParseBuffer
Pointer start() const { return Pointer(*this, mBuff, eof()); }
CurrentPosition position() const { return CurrentPosition(*this); }
Pointer end() const { return Pointer(*this, mEnd, true); }
+ size_t lengthRemaining() { return mEnd - mPosition; }
CurrentPosition skipChar()
{
diff --git a/rutil/dns/ares/ares_init.c b/rutil/dns/ares/ares_init.c
index 84b4b2c..a8ca11f 100644
--- a/rutil/dns/ares/ares_init.c
+++ b/rutil/dns/ares/ares_init.c
@@ -592,6 +592,7 @@ static int init_by_defaults_windows_nameservers_getadaptersaddresses(ares_channe
{
PIP_ADAPTER_DNS_SERVER_ADDRESS dnsServers = AI->FirstDnsServerAddress;
+ //printf("ARES Interface: Name=%s(%S), Type=%d, Status=%d\n", AI->AdapterName, AI->FriendlyName, AI->IfType, AI->OperStatus);
if(AI->IfType == IF_TYPE_TUNNEL || AI->IfType == IF_TYPE_SOFTWARE_LOOPBACK)
{
// Don't process TUNNEL or LOOPBACK adapters
@@ -621,7 +622,7 @@ static int init_by_defaults_windows_nameservers_getadaptersaddresses(ares_channe
// add v4 server if it doesn't exist already
if (find_server(channel->servers, channel->nservers, sa4->sin_addr) == -1)
{
- // printf( "ARES: %s\n", inet_ntop(sa4->sin_addr) );
+ //printf( " ARES: %d.%d.%d.%d\n", sa4->sin_addr.S_un.S_un_b.s_b1, sa4->sin_addr.S_un.S_un_b.s_b2, sa4->sin_addr.S_un.S_un_b.s_b3, sa4->sin_addr.S_un.S_un_b.s_b4 );
#ifdef USE_IPV6
channel->servers[ channel->nservers ].family = AF_INET;
#endif
@@ -642,7 +643,23 @@ static int init_by_defaults_windows_nameservers_getadaptersaddresses(ares_channe
else if(dnsServers->Address.lpSockaddr->sa_family == AF_INET6)
{
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)dnsServers->Address.lpSockaddr;
- if (memcmp(&sa6->sin6_addr, &in6addr_any, sizeof(sa6->sin6_addr)) != 0)
+
+ // Source: http://comments.gmane.org/gmane.network.dns.c-ares/1090
+ // Windows implements a draft RFC from 2001
+ // (http://tools.ietf.org/id/draft-ietf-ipngwg-dns-discovery-03.txt) that
+ // suggests that DNS resolvers try a couple of fixed "site-local" IPv6
+ // addresses (fec0:0:0:ffff::1, fec0:0:0:ffff::2 and fec0:0:0:ffff::3), which
+ // would allow the networking stack to find DNS servers without any
+ // configuration.
+
+ // The whole concept of site-local addresses is now considered problematic and
+ // the use of the fec0::/10 address range has been officially deprecated in RFC
+ // 3879 (http://www.ietf.org/rfc/rfc3879.txt) so it seems unlikely that this
+ // way of setting up DNS on a network will become popular in the future.
+
+ // Skip v6 address if inaddr_any or if site local (see above)
+ if (memcmp(&sa6->sin6_addr, &in6addr_any, sizeof(sa6->sin6_addr)) != 0 &&
+ ntohs(sa6->sin6_addr.u.Word[0]) != 0xfec0) // Addresses starting with 0xfec0 are site local addresses
{
if(loopnum == 1)
{
@@ -653,7 +670,9 @@ static int init_by_defaults_windows_nameservers_getadaptersaddresses(ares_channe
// add v6 server if it doesn't exist already
if (find_server6(channel->servers, channel->nservers, sa6->sin6_addr) == -1)
{
- // printf( "ARES: %s\n", inet_ntop6(sa6->sin6_addr) );
+ //printf( " ARES: %.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:\n",
+ // ntohs(sa6->sin6_addr.u.Word[0]), ntohs(sa6->sin6_addr.u.Word[1]), ntohs(sa6->sin6_addr.u.Word[2]), ntohs(sa6->sin6_addr.u.Word[3]),
+ // ntohs(sa6->sin6_addr.u.Word[4]), ntohs(sa6->sin6_addr.u.Word[5]), ntohs(sa6->sin6_addr.u.Word[6]), ntohs(sa6->sin6_addr.u.Word[7]));
channel->servers[ channel->nservers ].family = AF_INET6;
memcpy(&channel->servers[channel->nservers].addr6, &sa6->sin6_addr, sizeof(channel->servers[channel->nservers].addr6));
--
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