[Pkg-voip-commits] [resiprocate] 02/03: Make ensureWritable more tolerant.
Daniel Pocock
pocock at moszumanska.debian.org
Thu Mar 26 07:03:01 UTC 2015
This is an automated email from the git hooks/post-receive script.
pocock pushed a commit to annotated tag debian/1.9.7-5_bpo70+1
in repository resiprocate.
commit 74df1d684e8a41a14589de92eda7f51273750cb9
Author: Daniel Pocock <daniel at pocock.pro>
Date: Sun Mar 22 19:30:03 2015 +0100
Make ensureWritable more tolerant.
---
.../0004-make-ensureWritable-more-tolerant.patch | 55 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 56 insertions(+)
diff --git a/debian/patches/0004-make-ensureWritable-more-tolerant.patch b/debian/patches/0004-make-ensureWritable-more-tolerant.patch
new file mode 100644
index 0000000..1661a16
--- /dev/null
+++ b/debian/patches/0004-make-ensureWritable-more-tolerant.patch
@@ -0,0 +1,55 @@
+diff --git a/resip/stack/Connection.cxx b/resip/stack/Connection.cxx
+index 567c105..1f01ecc 100644
+--- a/resip/stack/Connection.cxx
++++ b/resip/stack/Connection.cxx
+@@ -88,13 +88,35 @@ Connection::performWrite()
+ {
+ if(transportWrite())
+ {
+- assert(mInWritable);
+- getConnectionManager().removeFromWritable(this);
+- mInWritable = false;
+- return 0; // What does this transportWrite() mean?
++ // If we get here it means:
++ // a. on a previous invocation, SSL_do_handshake wanted to write
++ // (SSL_ERROR_WANT_WRITE)
++ // b. now the handshake is complete or it wants to read
++ if(mInWritable)
++ {
++ getConnectionManager().removeFromWritable(this);
++ mInWritable = false;
++ }
++ else
++ {
++ WarningLog(<<"performWrite invoked while not in write set");
++ }
++ return 0; // Q. What does this transportWrite() mean?
++ // A. It makes the TLS handshake move along after it
++ // was waiting in the write set.
++ }
++
++ // If the TLS handshake returned SSL_ERROR_WANT_WRITE again
++ // then we could get here without really having something to write
++ // so just return, remaining in the write set.
++ if(mOutstandingSends.empty())
++ {
++ // FIXME: this needs to be more elaborate with respect
++ // to TLS handshaking but it doesn't appear we can do that
++ // without ABI breakage.
++ return 0;
+ }
+
+- assert(!mOutstandingSends.empty());
+ switch(mOutstandingSends.front()->command)
+ {
+ case SendData::CloseConnection:
+@@ -272,7 +294,8 @@ Connection::ensureWritable()
+ {
+ if(!mInWritable)
+ {
+- assert(!mOutstandingSends.empty());
++ //assert(!mOutstandingSends.empty()); // empty during TLS handshake
++ // therefore must be careful to check mOutstandingSends later
+ getConnectionManager().addToWritable(this);
+ mInWritable = true;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 01a37f5..6f6a9e9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
0001-use-SSLv23_method.patch
0002-client-avoid-TLSv1_2.patch
0003-log-tls-clean-shutdown.patch
+0004-make-ensureWritable-more-tolerant.patch
--
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