diff --git a/src/Driver/Http2Driver.php b/src/Driver/Http2Driver.php index bd676365..0e00e522 100644 --- a/src/Driver/Http2Driver.php +++ b/src/Driver/Http2Driver.php @@ -1169,7 +1169,7 @@ private function upgrade(Request $request, Response $response, int $id): void // The output of an upgraded connection is just DATA frames $outputPipe = new Pipe(0); - $upgraded = new UpgradedSocket($client, $inputStream, $outputPipe->getSink()); + $upgraded = new UpgradedSocket($client, $inputStream, $outputPipe->getSink(), $id); try { $upgradeHandler($upgraded, $request, $response); diff --git a/src/Driver/Http3Driver.php b/src/Driver/Http3Driver.php index 68605366..01add804 100644 --- a/src/Driver/Http3Driver.php +++ b/src/Driver/Http3Driver.php @@ -220,7 +220,7 @@ private function upgrade(QuicSocket $stream, Request $request, Response $respons $settings = $this->parsedSettings->getFuture()->await(); $datagramStream = empty($settings[Http3Settings::H3_DATAGRAM->value]) ? null : new Http3DatagramStream($this->parser->receiveDatagram(...), $this->writer->writeDatagram(...), $this->writer->maxDatagramSize(...), $stream); - $upgraded = new UpgradedSocket($client, $inputStream, $outputPipe->getSink(), $datagramStream); + $upgraded = new UpgradedSocket($client, $inputStream, $outputPipe->getSink(), $stream->getId(), $datagramStream); try { $upgradeHandler($upgraded, $request, $response); diff --git a/src/Driver/UpgradedSocket.php b/src/Driver/UpgradedSocket.php index 90abc4a9..167531c1 100644 --- a/src/Driver/UpgradedSocket.php +++ b/src/Driver/UpgradedSocket.php @@ -27,6 +27,7 @@ public function __construct( private readonly Client $client, private readonly ReadableStream $readableStream, private readonly WritableStream $writableStream, + public readonly int $id = 0, public readonly ?DatagramStream $datagramClient = null, ) { }