forked from quic-go/quic-go
expose the connection tracing ID on the stream context (#4414)
This is especially interesting for HTTP servers: They can now learn which connection a request was received on.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package quic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"os"
|
||||
"sync"
|
||||
@@ -85,7 +86,9 @@ type stream struct {
|
||||
var _ Stream = &stream{}
|
||||
|
||||
// newStream creates a new Stream
|
||||
func newStream(streamID protocol.StreamID,
|
||||
func newStream(
|
||||
ctx context.Context,
|
||||
streamID protocol.StreamID,
|
||||
sender streamSender,
|
||||
flowController flowcontrol.StreamFlowController,
|
||||
) *stream {
|
||||
@@ -99,7 +102,7 @@ func newStream(streamID protocol.StreamID,
|
||||
s.completedMutex.Unlock()
|
||||
},
|
||||
}
|
||||
s.sendStream = *newSendStream(streamID, senderForSendStream, flowController)
|
||||
s.sendStream = *newSendStream(ctx, streamID, senderForSendStream, flowController)
|
||||
senderForReceiveStream := &uniStreamSender{
|
||||
streamSender: sender,
|
||||
onStreamCompletedImpl: func() {
|
||||
|
||||
Reference in New Issue
Block a user