You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/08/23 05:51:49 UTC
[trafficserver] 01/02: Rename _request/_response_buffer_offset to
_recv/_send_offset
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 1d28d8c41ca04d8e97e8c49d5710dd1ee240ddba
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Wed Aug 23 12:10:56 2017 +0900
Rename _request/_response_buffer_offset to _recv/_send_offset
---
iocore/net/quic/QUICStream.cc | 20 ++++++++++++--------
iocore/net/quic/QUICStream.h | 7 ++++---
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index edd19ea..8a10c57 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -229,16 +229,16 @@ QUICStream::_write_to_read_vio(std::shared_ptr<const QUICStreamFrame> frame)
int bytes_added = this->_read_vio.buffer.writer()->write(frame->data(), frame->data_length());
this->_read_vio.nbytes += bytes_added;
- this->_request_buffer_offset += frame->data_length();
+ this->_recv_offset += frame->data_length();
}
void
QUICStream::_reorder_data()
{
- auto frame = _request_stream_frame_buffer.find(this->_request_buffer_offset);
+ auto frame = _request_stream_frame_buffer.find(this->_recv_offset);
while (frame != this->_request_stream_frame_buffer.end()) {
this->_write_to_read_vio(frame->second);
- frame = _request_stream_frame_buffer.find(this->_request_buffer_offset);
+ frame = _request_stream_frame_buffer.find(this->_recv_offset);
}
}
@@ -260,10 +260,14 @@ QUICStream::recv(std::shared_ptr<const QUICStreamFrame> frame)
}
this->_state.update_with_received_frame(*frame);
- if (this->_request_buffer_offset > frame->offset()) {
+ if (frame->offset() > this->_recv_largest_offset) {
+ this->_recv_largest_offset = frame->offset();
+ }
+
+ if (this->_recv_offset > frame->offset()) {
// Do nothing. Just ignore STREAM frame.
return;
- } else if (this->_request_buffer_offset == frame->offset()) {
+ } else if (this->_recv_offset == frame->offset()) {
this->_write_to_read_vio(frame);
this->_reorder_data();
} else {
@@ -298,10 +302,10 @@ QUICStream::_send()
len = data_len;
}
- std::unique_ptr<QUICStreamFrame, QUICFrameDeleterFunc> frame = QUICFrameFactory::create_stream_frame(
- reinterpret_cast<const uint8_t *>(reader->start()), len, this->_id, this->_response_buffer_offset);
+ std::unique_ptr<QUICStreamFrame, QUICFrameDeleterFunc> frame =
+ QUICFrameFactory::create_stream_frame(reinterpret_cast<const uint8_t *>(reader->start()), len, this->_id, this->_send_offset);
- this->_response_buffer_offset += len;
+ this->_send_offset += len;
reader->consume(len);
this->_write_vio.ndone += len;
total_len += len;
diff --git a/iocore/net/quic/QUICStream.h b/iocore/net/quic/QUICStream.h
index aeb5d65..1992d21 100644
--- a/iocore/net/quic/QUICStream.h
+++ b/iocore/net/quic/QUICStream.h
@@ -81,9 +81,10 @@ private:
Event *_send_tracked_event(Event *event, int send_event, VIO *vio);
- QUICStreamId _id = 0;
- QUICOffset _request_buffer_offset = 0;
- QUICOffset _response_buffer_offset = 0;
+ QUICStreamId _id = 0;
+ QUICOffset _recv_offset = 0;
+ QUICOffset _recv_largest_offset = 0;
+ QUICOffset _send_offset = 0;
VIO _read_vio;
VIO _write_vio;
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.