Repository: trafficserver Updated Branches: refs/heads/5.1.x ad75ffae8 -> 45f23caf6
TS-2983: Fix protocol probe to not drop data. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/45f23caf Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/45f23caf Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/45f23caf Branch: refs/heads/5.1.x Commit: 45f23caf69043174ef4e60f35b6661c08d726d4e Parents: ad75ffa Author: Alan M. Carroll <[email protected]> Authored: Fri Aug 22 12:14:18 2014 -0500 Committer: Alan M. Carroll <[email protected]> Committed: Fri Aug 22 12:22:56 2014 -0500 ---------------------------------------------------------------------- CHANGES | 2 ++ proxy/ProtocolProbeSessionAccept.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45f23caf/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 91a5747..84b0726 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ Changes with Apache Traffic Server 5.1.0 *) [TS-2983] Fix protocol probe to not skip data. + *) [TS-2983] Fix protocol probe to not skip data. + *) [TS-2970] Prevent asserts with transparent pass through. *) [TS-2995] Apply TOS/SO marks to client connection in all accept cases. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45f23caf/proxy/ProtocolProbeSessionAccept.cc ---------------------------------------------------------------------- diff --git a/proxy/ProtocolProbeSessionAccept.cc b/proxy/ProtocolProbeSessionAccept.cc index dc36653..391604e 100644 --- a/proxy/ProtocolProbeSessionAccept.cc +++ b/proxy/ProtocolProbeSessionAccept.cc @@ -58,19 +58,20 @@ struct ProtocolProbeTrampoline : public Continuation, public ProtocolProbeSessio { static const size_t minimum_read_size = 1; static const unsigned buffer_size_index = CLIENT_CONNECTION_FIRST_READ_BUFFER_SIZE_INDEX; + IOBufferReader * reader; explicit ProtocolProbeTrampoline(const ProtocolProbeSessionAccept * probe, ProxyMutex * mutex) : Continuation(mutex), probeParent(probe) { this->iobuf = new_MIOBuffer(buffer_size_index); + reader = iobuf->alloc_reader(); // reader must be allocated only on a new MIOBuffer. SET_HANDLER(&ProtocolProbeTrampoline::ioCompletionEvent); } int ioCompletionEvent(int event, void * edata) { VIO * vio; - IOBufferReader * reader; NetVConnection * netvc; ProtoGroupKey key = N_PROTO_GROUPS; // use this as an invalid value. @@ -92,7 +93,6 @@ struct ProtocolProbeTrampoline : public Continuation, public ProtocolProbeSessio return EVENT_ERROR; } - reader = iobuf->alloc_reader(); ink_assert(netvc != NULL); if (!reader->is_read_avail_more_than(minimum_read_size - 1)) {
