Repository: trafficserver Updated Branches: refs/heads/master aa37d0ab5 -> 6a8764915
[TS-3226]: Move access of read vio inside the mutex to prevent ntodo corruption Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3c1aee78 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3c1aee78 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3c1aee78 Branch: refs/heads/master Commit: 3c1aee78b46282f91e7f92369a2ff3231304117c Parents: aa37d0a Author: Sudheer Vinukonda <[email protected]> Authored: Wed Dec 10 22:41:58 2014 +0000 Committer: Sudheer Vinukonda <[email protected]> Committed: Wed Dec 10 22:41:58 2014 +0000 ---------------------------------------------------------------------- iocore/net/SSLNetVConnection.cc | 4 ++-- iocore/net/UnixNetVConnection.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3c1aee78/iocore/net/SSLNetVConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc index 4a9ec29..871c5a0 100644 --- a/iocore/net/SSLNetVConnection.cc +++ b/iocore/net/SSLNetVConnection.cc @@ -387,8 +387,6 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread) int64_t r = 0; int64_t bytes = 0; NetState *s = &this->read; - MIOBufferAccessor &buf = s->vio.buffer; - int64_t ntodo = s->vio.ntodo(); if (HttpProxyPort::TRANSPORT_BLIND_TUNNEL == this->attributes) { this->super::net_read_io(nh, lthread); @@ -415,6 +413,8 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread) return; } + MIOBufferAccessor &buf = s->vio.buffer; + int64_t ntodo = s->vio.ntodo(); ink_assert(buf.writer()); // This function will always return true unless http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3c1aee78/iocore/net/UnixNetVConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc index 6adc4ee..c497c2d 100644 --- a/iocore/net/UnixNetVConnection.cc +++ b/iocore/net/UnixNetVConnection.cc @@ -209,7 +209,6 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) { NetState *s = &vc->read; ProxyMutex *mutex = thread->mutex; - MIOBufferAccessor & buf = s->vio.buffer; int64_t r = 0; MUTEX_TRY_LOCK_FOR(lock, s->vio.mutex, thread, s->vio._cont); @@ -224,6 +223,7 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) return; } + MIOBufferAccessor & buf = s->vio.buffer; ink_assert(buf.writer()); // if there is nothing to do, disable connection
