File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
quinn-proto/src/connection Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -565,7 +565,7 @@ impl Connection {
565565 // We need to send 1 more datagram and extend the buffer for that.
566566
567567 // Is 1 more datagram allowed?
568- if transmit. num_datagrams ( ) >= transmit . max_datagrams ( ) {
568+ if transmit. has_datagram_capacity ( ) {
569569 // No more datagrams allowed
570570 break ;
571571 }
Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ impl<'a> TransmitBuilder<'a> {
160160 & self . buf [ self . datagram_start ..]
161161 }
162162
163+ /// Whether there is space for another datagram in this transmit
164+ pub ( super ) fn has_datagram_capacity ( & self ) -> bool {
165+ self . num_datagrams >= self . max_datagrams
166+ }
167+
163168 /// Returns the GSO segment size
164169 ///
165170 /// This is also the maximum size datagrams are allowed to be. The first and last
@@ -176,11 +181,6 @@ impl<'a> TransmitBuilder<'a> {
176181 self . num_datagrams
177182 }
178183
179- /// Returns the maximum number of datagrams allowed to be written into the buffer
180- pub ( super ) fn max_datagrams ( & self ) -> usize {
181- self . max_datagrams
182- }
183-
184184 /// Returns `true` if there are no datagrams in this transmit
185185 pub ( super ) fn is_empty ( & self ) -> bool {
186186 self . len ( ) == 0
You can’t perform that action at this time.
0 commit comments