You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/02/19 17:47:50 UTC
[4/5] git commit: TS-841: Propagate zero-length read events through
SSL
TS-841: Propagate zero-length read events through SSL
Don't optimize away zero-length reads from SSLNetVConnection. We
need to support this so that we can complete the SSL handshake
without reading anything from the data channel.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/115434b2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/115434b2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/115434b2
Branch: refs/heads/master
Commit: 115434b27a4f241c59e29970bd1f210e552a66c7
Parents: 89e24d7
Author: James Peach <jp...@apache.org>
Authored: Sun Feb 12 21:40:00 2012 -0800
Committer: James Peach <jp...@apache.org>
Committed: Sun Feb 19 08:46:08 2012 -0800
----------------------------------------------------------------------
iocore/net/SSLNetVConnection.cc | 4 ++++
iocore/net/UnixNetVConnection.cc | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/115434b2/iocore/net/SSLNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 2955733..ff7df1d 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -219,10 +219,14 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread)
readReschedule(nh);
return;
}
+
// If there is nothing to do, disable connection
int64_t ntodo = s->vio.ntodo();
if (ntodo <= 0) {
read_disable(nh, this);
+ // Don't return early even if there's nothing. We still need
+ // to propagate events for zero-length reads.
+ readSignalDone(VC_EVENT_READ_COMPLETE, nh);
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/115434b2/iocore/net/UnixNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 5c8986a..b59294b 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -532,7 +532,7 @@ UnixNetVConnection::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf)
read.vio.vc_server = (VConnection *) this;
if (buf) {
read.vio.buffer.writer_for(buf);
- if (nbytes && !read.enabled)
+ if (!read.enabled)
read.vio.reenable();
} else {
read.vio.buffer.clear();