Repository: trafficserver Updated Branches: refs/heads/5.2.x 6508ab507 -> 66504c160
[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/6972d4d6 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6972d4d6 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6972d4d6 Branch: refs/heads/5.2.x Commit: 6972d4d61a7341ee700b94164a8bd884cb12923f Parents: 6508ab5 Author: Sudheer Vinukonda <[email protected]> Authored: Wed Dec 10 22:41:58 2014 +0000 Committer: Sudheer Vinukonda <[email protected]> Committed: Thu Dec 18 17:06:25 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/6972d4d6/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/6972d4d6/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
