Skip to content

Add a readonly modifier to a missing readonly field #24379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal class Http3Connection : IRequestProcessor, ITimeoutHandler
private long _highestOpenedStreamId; // TODO lock to access
private volatile bool _haveSentGoAway;
private readonly object _sync = new object();
private MultiplexedConnectionContext _multiplexedContext;
private readonly MultiplexedConnectionContext _multiplexedContext;
private readonly Http3ConnectionContext _context;
private readonly ISystemClock _systemClock;
private readonly TimeoutControl _timeoutControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ internal abstract class Http3ControlStream : IThreadPoolWorkItem
private const int EncoderStream = 2;
private const int DecoderStream = 3;

private Http3FrameWriter _frameWriter;
private readonly Http3FrameWriter _frameWriter;
private readonly Http3Connection _http3Connection;
private HttpConnectionContext _context;
private readonly HttpConnectionContext _context;
private readonly Http3RawFrame _incomingFrame = new Http3RawFrame();
private volatile int _isClosed;
private int _gracefulCloseInitiator;
Expand Down
4 changes: 2 additions & 2 deletions src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ internal abstract class Http3Stream : HttpProtocol, IHttpHeadersHandler, IThread
private static ReadOnlySpan<byte> TrailersBytes => new byte[8] { (byte)'t', (byte)'r', (byte)'a', (byte)'i', (byte)'l', (byte)'e', (byte)'r', (byte)'s' };
private static ReadOnlySpan<byte> ConnectBytes => new byte[7] { (byte)'C', (byte)'O', (byte)'N', (byte)'N', (byte)'E', (byte)'C', (byte)'T' };

private Http3FrameWriter _frameWriter;
private Http3OutputProducer _http3Output;
private readonly Http3FrameWriter _frameWriter;
private readonly Http3OutputProducer _http3Output;
private int _isClosed;
private int _gracefulCloseInitiator;
private readonly Http3StreamContext _context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private enum State
private const byte InsertCountIncrementPrefixMask = 0x3F;
private const int InsertCountIncrementPrefix = 6;

private IntegerDecoder _integerDecoder = new IntegerDecoder();
private readonly IntegerDecoder _integerDecoder = new IntegerDecoder();
private State _state;

public DecoderStreamReader()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ private enum State
private const byte HuffmanMask = 0x80;

private bool _s;
private byte[] _stringOctets;
private byte[] _headerNameOctets;
private byte[] _headerValueOctets;
private readonly byte[] _stringOctets;
private readonly byte[] _headerNameOctets;
private readonly byte[] _headerValueOctets;
private byte[] _headerName;
private int _headerNameLength;
private int _headerValueLength;
private int _stringLength;
private int _stringIndex;
private DynamicTable _dynamicTable = new DynamicTable(1000); // TODO figure out architecture.
private readonly DynamicTable _dynamicTable = new DynamicTable(1000); // TODO figure out architecture.

private readonly IntegerDecoder _integerDecoder = new IntegerDecoder();
private State _state = State.Ready;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class Heartbeat : IDisposable
private readonly IDebugger _debugger;
private readonly IKestrelTrace _trace;
private readonly TimeSpan _interval;
private Thread _timerThread;
private readonly Thread _timerThread;
private volatile bool _stopped;

public Heartbeat(IHeartbeatHandler[] callbacks, ISystemClock systemClock, IDebugger debugger, IKestrelTrace trace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{
internal class ThreadPoolAwaitable : ICriticalNotifyCompletion
{
public static ThreadPoolAwaitable Instance = new ThreadPoolAwaitable();
public static readonly ThreadPoolAwaitable Instance = new ThreadPoolAwaitable();

private ThreadPoolAwaitable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
{
internal class KestrelServerOptionsSetup : IConfigureOptions<KestrelServerOptions>
{
private IServiceProvider _services;
private readonly IServiceProvider _services;

public KestrelServerOptionsSetup(IServiceProvider services)
{
Expand Down