This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/quic-latest by this push:
new c6db432 Small refactoring
c6db432 is described below
commit c6db432e5f2a6e5fe003028d1f5325f9974a6f85
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Fri Jun 22 14:41:23 2018 +0900
Small refactoring
---
iocore/net/quic/QUICPacket.cc | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc
index 7010acd..777a560 100644
--- a/iocore/net/quic/QUICPacket.cc
+++ b/iocore/net/quic/QUICPacket.cc
@@ -132,14 +132,11 @@ QUICPacketLongHeader::QUICPacketLongHeader(const
IpEndpoint from, ats_unique_buf
{
uint8_t *raw_buf = this->_buf.get();
- uint8_t dcil = (raw_buf[5] >> 4);
- if (dcil) {
- dcil += 3;
- }
- uint8_t scil = (raw_buf[5] & 0x0F);
- if (scil) {
- scil += 3;
- }
+ uint8_t dcil = 0;
+ uint8_t scil = 0;
+ QUICPacketLongHeader::dcil(dcil, raw_buf, len);
+ QUICPacketLongHeader::dcil(scil, raw_buf, len);
+
size_t offset = LONG_HDR_OFFSET_CONNECTION_ID;
this->_destination_cid = {raw_buf + offset, dcil};
offset += dcil;