@@ -27,6 +27,7 @@ use h3::{
27
27
quic:: { self , Error , StreamId , WriteBuf } ,
28
28
} ;
29
29
use tokio_util:: sync:: ReusableBoxFuture ;
30
+ use tracing:: instrument;
30
31
31
32
/// A QUIC connection backed by Quinn
32
33
///
@@ -155,6 +156,7 @@ where
155
156
type OpenStreams = OpenStreams ;
156
157
type AcceptError = ConnectionError ;
157
158
159
+ #[ instrument( skip_all) ]
158
160
fn poll_accept_bidi (
159
161
& mut self ,
160
162
cx : & mut task:: Context < ' _ > ,
@@ -169,6 +171,7 @@ where
169
171
} ) ) )
170
172
}
171
173
174
+ #[ instrument( skip_all) ]
172
175
fn poll_accept_recv (
173
176
& mut self ,
174
177
cx : & mut task:: Context < ' _ > ,
@@ -197,6 +200,7 @@ where
197
200
type BidiStream = BidiStream < B > ;
198
201
type OpenError = ConnectionError ;
199
202
203
+ #[ instrument( skip_all) ]
200
204
fn poll_open_bidi (
201
205
& mut self ,
202
206
cx : & mut task:: Context < ' _ > ,
@@ -215,6 +219,7 @@ where
215
219
} ) )
216
220
}
217
221
222
+ #[ instrument( skip_all) ]
218
223
fn poll_open_send (
219
224
& mut self ,
220
225
cx : & mut task:: Context < ' _ > ,
@@ -229,6 +234,7 @@ where
229
234
Poll :: Ready ( Ok ( Self :: SendStream :: new ( send) ) )
230
235
}
231
236
237
+ #[ instrument( skip_all) ]
232
238
fn close ( & mut self , code : h3:: error:: Code , reason : & [ u8 ] ) {
233
239
self . conn . close (
234
240
VarInt :: from_u64 ( code. value ( ) ) . expect ( "error code VarInt" ) ,
@@ -243,6 +249,7 @@ where
243
249
{
244
250
type Error = SendDatagramError ;
245
251
252
+ #[ instrument( skip_all) ]
246
253
fn send_datagram ( & mut self , data : Datagram < B > ) -> Result < ( ) , SendDatagramError > {
247
254
// TODO investigate static buffer from known max datagram size
248
255
let mut buf = BytesMut :: new ( ) ;
@@ -259,6 +266,7 @@ impl quic::RecvDatagramExt for Connection {
259
266
type Error = ConnectionError ;
260
267
261
268
#[ inline]
269
+ #[ instrument( skip_all) ]
262
270
fn poll_accept_datagram (
263
271
& mut self ,
264
272
cx : & mut task:: Context < ' _ > ,
@@ -289,6 +297,7 @@ where
289
297
type BidiStream = BidiStream < B > ;
290
298
type OpenError = ConnectionError ;
291
299
300
+ #[ instrument( skip_all) ]
292
301
fn poll_open_bidi (
293
302
& mut self ,
294
303
cx : & mut task:: Context < ' _ > ,
@@ -307,6 +316,7 @@ where
307
316
} ) )
308
317
}
309
318
319
+ #[ instrument( skip_all) ]
310
320
fn poll_open_send (
311
321
& mut self ,
312
322
cx : & mut task:: Context < ' _ > ,
@@ -321,6 +331,7 @@ where
321
331
Poll :: Ready ( Ok ( Self :: SendStream :: new ( send) ) )
322
332
}
323
333
334
+ #[ instrument( skip_all) ]
324
335
fn close ( & mut self , code : h3:: error:: Code , reason : & [ u8 ] ) {
325
336
self . conn . close (
326
337
VarInt :: from_u64 ( code. value ( ) ) . expect ( "error code VarInt" ) ,
@@ -452,6 +463,7 @@ impl quic::RecvStream for RecvStream {
452
463
type Buf = Bytes ;
453
464
type Error = ReadError ;
454
465
466
+ #[ instrument( skip_all) ]
455
467
fn poll_data (
456
468
& mut self ,
457
469
cx : & mut task:: Context < ' _ > ,
@@ -468,6 +480,7 @@ impl quic::RecvStream for RecvStream {
468
480
Poll :: Ready ( Ok ( chunk?. map ( |c| c. bytes ) ) )
469
481
}
470
482
483
+ #[ instrument( skip_all) ]
471
484
fn stop_sending ( & mut self , error_code : u64 ) {
472
485
self . stream
473
486
. as_mut ( )
@@ -476,6 +489,7 @@ impl quic::RecvStream for RecvStream {
476
489
. ok ( ) ;
477
490
}
478
491
492
+ #[ instrument( skip_all) ]
479
493
fn recv_id ( & self ) -> StreamId {
480
494
self . stream
481
495
. as_ref ( )
@@ -573,6 +587,7 @@ where
573
587
{
574
588
type Error = SendStreamError ;
575
589
590
+ #[ instrument( skip_all) ]
576
591
fn poll_ready ( & mut self , cx : & mut task:: Context < ' _ > ) -> Poll < Result < ( ) , Self :: Error > > {
577
592
if let Some ( ref mut data) = self . writing {
578
593
while data. has_remaining ( ) {
@@ -598,10 +613,12 @@ where
598
613
Poll :: Ready ( Ok ( ( ) ) )
599
614
}
600
615
616
+ #[ instrument( skip_all) ]
601
617
fn poll_finish ( & mut self , _cx : & mut task:: Context < ' _ > ) -> Poll < Result < ( ) , Self :: Error > > {
602
618
Poll :: Ready ( self . stream . as_mut ( ) . unwrap ( ) . finish ( ) . map_err ( |e| e. into ( ) ) )
603
619
}
604
620
621
+ #[ instrument( skip_all) ]
605
622
fn reset ( & mut self , reset_code : u64 ) {
606
623
let _ = self
607
624
. stream
@@ -610,6 +627,7 @@ where
610
627
. reset ( VarInt :: from_u64 ( reset_code) . unwrap_or ( VarInt :: MAX ) ) ;
611
628
}
612
629
630
+ #[ instrument( skip_all) ]
613
631
fn send_data < D : Into < WriteBuf < B > > > ( & mut self , data : D ) -> Result < ( ) , Self :: Error > {
614
632
if self . writing . is_some ( ) {
615
633
return Err ( Self :: Error :: NotReady ) ;
@@ -618,6 +636,7 @@ where
618
636
Ok ( ( ) )
619
637
}
620
638
639
+ #[ instrument( skip_all) ]
621
640
fn send_id ( & self ) -> StreamId {
622
641
self . stream
623
642
. as_ref ( )
@@ -633,6 +652,7 @@ impl<B> quic::SendStreamUnframed<B> for SendStream<B>
633
652
where
634
653
B : Buf ,
635
654
{
655
+ #[ instrument( skip_all) ]
636
656
fn poll_send < D : Buf > (
637
657
& mut self ,
638
658
cx : & mut task:: Context < ' _ > ,
0 commit comments