Skip to content

Commit e36fa90

Browse files
committed
fixup! quic: extract transport logic from Application to Session
Cleanup max_packet_size handling
1 parent eef9fce commit e36fa90

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎src/quic/session.cc‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,12 +1911,9 @@ void Session::SendPendingData() {
19111911
s->UpdateDataStats();
19121912
});
19131913

1914-
// The maximum size of packet to create.
1915-
const size_t max_pktlen = max_packet_size();
1916-
19171914
// The maximum number of packets to send in this call to SendPendingData.
1918-
const size_t max_packet_count =
1919-
std::min(kMaxPackets, ngtcp2_conn_get_send_quantum(*this) / max_pktlen);
1915+
const size_t max_packet_count = std::min(
1916+
kMaxPackets, ngtcp2_conn_get_send_quantum(*this) / max_packet_size());
19201917
if (max_packet_count == 0) return;
19211918

19221919
// The number of packets that have been prepared in this call.
@@ -2158,7 +2155,7 @@ ssize_t Session::WriteVStream(PathStorage* path,
21582155
PacketInfo* pi,
21592156
uint8_t* dest,
21602157
ssize_t* ndatalen,
2161-
size_t max_pktlen,
2158+
size_t max_packet_size,
21622159
const StreamData& stream_data,
21632160
uint64_t ts) {
21642161
DCHECK_LE(stream_data.count, kMaxVectorCount);
@@ -2171,7 +2168,7 @@ ssize_t Session::WriteVStream(PathStorage* path,
21712168
&path->path,
21722169
*pi,
21732170
dest,
2174-
max_pktlen,
2171+
max_packet_size,
21752172
ndatalen,
21762173
flags,
21772174
stream_data.id,

0 commit comments

Comments
 (0)