53 http3RequestStream._connection =
null;
286 bool flag = (byte)num != 0;
393 Trace(
$"Expected HEADERS as first response frame; received {http3FrameType}.",
"ReadResponseAsync");
506 Trace(
"Response content exceeded Content-Length.",
"DrainContentLength0Frames");
568 if (
request.HasHeaders &&
request.Headers.TransferEncodingChunked ==
true)
570 request.Headers.TransferEncodingChunked =
false;
594 int num = _sendBuffer.ActiveLength - 9;
603 if (
headers.HeaderStore ==
null)
737 Trace(
$"Received frame {a} of length {b}.",
"ReadFrameEnvelopeAsync");
787 Trace(
$"Server closed response stream before entire header payload could be read. {headersLength:N0} bytes remaining.",
"ReadHeadersAsync");
828 Trace(
$"Response contains invalid static header index '{index}'.",
"GetStaticQPackHeader");
836 if (descriptor.
Name[0] ==
':')
842 Trace(
"Received unknown pseudo-header '" + descriptor.
Name +
"'.",
"OnHeader");
850 Trace(
"Received extra status header.",
"OnHeader");
891 bool result = num < 300;
894 Trace(
$"Expecting 100 Continue but received final status {num}.",
"OnHeader");
916 Trace(
"Received headers without :status.",
"OnHeader");
938 string message =
$"Unexpected QPACK table reference for Status code: index={index} value='{value}'";
941 Trace(message,
"OnHeader");
1016 while (
buffer.Length != 0)
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
virtual ValueTask DisposeAsync()
static byte Min(byte val1, byte val2)
string GetCookieHeader(Uri uri)
static readonly Version Version30
static void ProcessReceivedCookies(HttpResponseMessage response, CookieContainer cookieContainer)
static EmptyReadStream Instance
override void Trace(string message, [CallerMemberName] string memberName=null)
void RemoveStream(QuicStream stream)
Exception Abort(Exception abortException)
byte[] AltUsedEncodedHeaderBytes
static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span< byte > buffer, out int bytesWritten)
static bool TryReadIntegerPair(ReadOnlySpan< byte > buffer, out long a, out long b, out int bytesRead)
override async ValueTask DisposeAsync()
HttpResponseMessage _response
Http3RequestStream _stream
override ValueTask< int > ReadAsync(Memory< byte > buffer, CancellationToken cancellationToken)
Http3ReadStream(Http3RequestStream stream)
override void Dispose(bool disposing)
override ValueTask WriteAsync(ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken)
override int Read(Span< byte > buffer)
Http3WriteStream(Http3RequestStream stream)
override Task FlushAsync(CancellationToken cancellationToken)
override ValueTask WriteAsync(ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken)
Http3RequestStream _stream
override int Read(Span< byte > buffer)
override ValueTask< int > ReadAsync(Memory< byte > buffer, CancellationToken cancellationToken)
override void Dispose(bool disposing)
void BufferHeaderCollection(HttpHeaders headers)
void CopyTrailersToResponseMessage(HttpResponseMessage responseMessage)
async ValueTask DrainContentLength0Frames(CancellationToken cancellationToken)
long _responseDataPayloadRemaining
bool _singleDataFrameWritten
void BufferLiteralHeaderWithoutNameReference(string name, ReadOnlySpan< string > values, string separator, Encoding valueEncoding)
async Task ReadResponseAsync(CancellationToken cancellationToken)
async ValueTask< bool > ReadNextDataFrameAsync(HttpResponseMessage response, CancellationToken cancellationToken)
long _headerBudgetRemaining
async ValueTask ReadHeadersAsync(long headersLength, CancellationToken cancellationToken)
QPackDecoder _headerDecoder
Http3RequestStream(HttpRequestMessage request, Http3Connection connection, QuicStream stream)
async ValueTask DisposeAsync()
async ValueTask WriteRequestContentAsync(ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken)
int ReadResponseContent(HttpResponseMessage response, Span< byte > buffer)
void IHttpHeadersHandler. OnHeader(ReadOnlySpan< byte > name, ReadOnlySpan< byte > value)
async ValueTask< int > ReadResponseContentAsync(HttpResponseMessage response, Memory< byte > buffer, CancellationToken cancellationToken)
void BufferIndexedHeader(int index)
void BufferFrameEnvelope(Http3FrameType frameType, long payloadLength)
System.Net.ArrayBuffer _recvBuffer
void BufferBytes(ReadOnlySpan< byte > span)
long _requestContentLengthRemaining
void Trace(string message, [CallerMemberName] string memberName=null)
async ValueTask<(Http3FrameType? frameType, long payloadLength)> ReadFrameEnvelopeAsync(CancellationToken cancellationToken)
async ValueTask FlushSendBufferAsync(bool endStream, CancellationToken cancellationToken)
void HandleReadResponseContentException(Exception ex, CancellationToken cancellationToken)
void GetStaticQPackHeader(int index, out HeaderDescriptor descriptor, out string knownValue)
void BufferHeaders(HttpRequestMessage request)
void BufferLiteralHeaderValues(ReadOnlySpan< string > values, string separator, Encoding valueEncoding)
HttpResponseMessage _response
readonly ReadOnlyMemory< byte >[] _gatheredSendBuffer
async Task< HttpResponseMessage > SendAsync(CancellationToken cancellationToken)
System.Net.ArrayBuffer _sendBuffer
async ValueTask SkipUnknownPayloadAsync(long payloadLength, CancellationToken cancellationToken)
List<(HeaderDescriptor name, string value)> _trailingHeaders
void OnHeader(int? staticIndex, HeaderDescriptor descriptor, string staticValue, ReadOnlySpan< byte > literalValue)
readonly HttpRequestMessage _request
Http3Connection _connection
void BufferLiteralHeaderWithStaticNameReference(int nameIndex, string value, Encoding valueEncoding=null)
CancellationToken _goawayCancellationToken
TaskCompletionSource< bool > _expect100ContinueCompletionSource
CancellationTokenSource _goawayCancellationSource
void BufferLiteralHeaderWithoutNameReference(string name, string value, Encoding valueEncoding)
async Task SendContentAsync(HttpContent content, CancellationToken cancellationToken)
string GetResponseHeaderValueWithCaching(HeaderDescriptor descriptor, ReadOnlySpan< byte > value, Encoding valueEncoding)
void LogExceptions(Task task)
static int ParseStatusCode(ReadOnlySpan< byte > value)
HttpConnectionSettings Settings
readonly byte[] _http3EncodedAuthorityHostHeader
HeaderEncodingSelector< HttpRequestMessage > _responseHeaderEncodingSelector
HeaderEncodingSelector< HttpRequestMessage > _requestHeaderEncodingSelector
TimeSpan _expect100ContinueTimeout
CookieContainer _cookieContainer
int _maxResponseHeadersLength
Task CopyToAsync(Stream stream)
HttpContentHeaders Headers
static HttpMethod Normalize(HttpMethod method)
HttpRequestHeaders Headers
HttpResponseHeaders Headers
HttpStatusCode StatusCode
void Decode(ReadOnlySpan< byte > headerBlock, IHttpHeadersHandler handler)
static bool EncodeStaticIndexedHeaderField(int index, Span< byte > destination, out int bytesWritten)
static bool EncodeValueString(string s, Encoding valueEncoding, Span< byte > buffer, out int length)
static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Span< byte > destination, out int bytesWritten)
static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Span< byte > destination, out int bytesWritten)
static int WriteInteger(Span< byte > buffer, long longToEncode)
static int GetByteCount(long value)
static readonly System.Net.NetEventSource Log
override Task FlushAsync(CancellationToken cancellationToken)
override void Dispose(bool disposing)
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override Task< int > ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
void AbortWrite(long errorCode)
void AbortRead(long errorCode)
override int Read(byte[] buffer, int offset, int count)
static string net_http_invalid_response_premature_eof
static string net_http_invalid_response
static string net_http_response_headers_exceeded_length
static string Format(string resourceFormat, object p1)
static string net_http_client_execution_error
static string net_http_retry_on_older_version
static string net_http_invalid_response_premature_eof_bytecount
static string net_http_request_aborted
static string net_http_content_write_larger_than_content_length
static string net_http_invalid_response_header_name
static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token1, CancellationToken token2)
static int Exchange(ref int location1, int value)
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
static Task FromException(Exception exception)
static Task CompletedTask
static Task< Task > WhenAny(params Task[] tasks)
static readonly TimeSpan InfiniteTimeSpan
static bool Read(ref bool location)
static void Write(ref bool location, bool value)
void OnStaticIndexedHeader(int index)
void OnHeader(ReadOnlySpan< byte > name, ReadOnlySpan< byte > value)
static CancellationToken None
static ValueTask FromException(Exception exception)