| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.IO; |
| | | 5 | | |
| | | 6 | | namespace System.Net.Http |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Represents the context passed to the PlaintextStreamFilter for a SocketsHttpHandler instance. |
| | | 10 | | /// </summary> |
| | | 11 | | public sealed class SocketsHttpPlaintextStreamFilterContext |
| | | 12 | | { |
| | | 13 | | private readonly Stream _plaintextStream; |
| | | 14 | | private readonly Version _negotiatedHttpVersion; |
| | | 15 | | private readonly HttpRequestMessage _initialRequestMessage; |
| | | 16 | | |
| | 0 | 17 | | internal SocketsHttpPlaintextStreamFilterContext(Stream plaintextStream, Version negotiatedHttpVersion, HttpRequ |
| | 0 | 18 | | { |
| | 0 | 19 | | _plaintextStream = plaintextStream; |
| | 0 | 20 | | _negotiatedHttpVersion = negotiatedHttpVersion; |
| | 0 | 21 | | _initialRequestMessage = initialRequestMessage; |
| | 0 | 22 | | } |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// The plaintext Stream that will be used for HTTP protocol requests and responses. |
| | | 26 | | /// </summary> |
| | 0 | 27 | | public Stream PlaintextStream => _plaintextStream; |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// The version of HTTP in use for this stream. |
| | | 31 | | /// </summary> |
| | 0 | 32 | | public Version NegotiatedHttpVersion => _negotiatedHttpVersion; |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// The initial HttpRequestMessage that is causing the stream to be used. |
| | | 36 | | /// </summary> |
| | 0 | 37 | | public HttpRequestMessage InitialRequestMessage => _initialRequestMessage; |
| | | 38 | | } |
| | | 39 | | } |