Eliminate some compile warnings (#600)

* Remove some unused variables
* remove duplicate "using .." by sorting and deduping the list
* Remove things that already exist in the parent class (in one case I moved some documentation to the parent)
* EntityBodyData and and NextSearch were never set (only read), removed
* _timeout was never read, subsequently _timer became unused. part of a TODO timeout functionality that was not implemented yet
This commit is contained in:
hawken 2019-01-24 18:56:43 +01:00 committed by Bond-009
parent b2ffad9ce9
commit 3701ce4037
6 changed files with 1 additions and 47 deletions

View File

@ -357,7 +357,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var list = new List<Tuple<StringBuilder, bool>>(); var list = new List<Tuple<StringBuilder, bool>>();
int thisMarker = 0, thisNumericChunk = 0; int thisMarker = 0;
while (thisMarker < s1.Length) while (thisMarker < s1.Length)
{ {

View File

@ -47,7 +47,6 @@ namespace Mono.Nat
{ {
public event EventHandler<DeviceEventArgs> DeviceFound; public event EventHandler<DeviceEventArgs> DeviceFound;
private DateTime nextSearch;
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IHttpClient _httpClient; private readonly IHttpClient _httpClient;
@ -98,11 +97,6 @@ namespace Mono.Nat
{ {
} }
public DateTime NextSearch
{
get { return nextSearch; }
}
private void OnDeviceFound(DeviceEventArgs args) private void OnDeviceFound(DeviceEventArgs args)
{ {
if (DeviceFound != null) if (DeviceFound != null)

View File

@ -13,12 +13,6 @@ namespace SocketHttpListener
#endregion #endregion
#region Internal Fields
internal byte[] EntityBodyData;
#endregion
#region Protected Fields #region Protected Fields
protected const string CrLf = "\r\n"; protected const string CrLf = "\r\n";
@ -37,18 +31,6 @@ namespace SocketHttpListener
#region Public Properties #region Public Properties
public string EntityBody
{
get
{
var data = EntityBodyData;
return data != null && data.Length > 0
? getEncoding(_headers["Content-Type"]).GetString(data, 0, data.Length)
: string.Empty;
}
}
public QueryParamCollection Headers => _headers; public QueryParamCollection Headers => _headers;
public Version ProtocolVersion => _version; public Version ProtocolVersion => _version;

View File

@ -115,10 +115,6 @@ namespace SocketHttpListener
output.Append(CrLf); output.Append(CrLf);
var entity = EntityBody;
if (entity.Length > 0)
output.Append(entity);
return output.ToString(); return output.ToString();
} }

View File

@ -32,8 +32,6 @@ namespace SocketHttpListener.Net
int _reuses; int _reuses;
bool _contextBound; bool _contextBound;
bool secure; bool secure;
int _timeout = 90000; // 90k ms for first request, 15k ms from then on
private Timer _timer;
IPEndPoint local_ep; IPEndPoint local_ep;
HttpListener _lastListener; HttpListener _lastListener;
X509Certificate cert; X509Certificate cert;
@ -91,8 +89,6 @@ namespace SocketHttpListener.Net
public async Task Init() public async Task Init()
{ {
_timer = new Timer(OnTimeout, null, Timeout.Infinite, Timeout.Infinite);
if (ssl_stream != null) if (ssl_stream != null)
{ {
var enableAsync = true; var enableAsync = true;
@ -162,14 +158,10 @@ namespace SocketHttpListener.Net
_buffer = new byte[BufferSize]; _buffer = new byte[BufferSize];
try try
{ {
if (_reuses == 1)
_timeout = 15000;
//_timer.Change(_timeout, Timeout.Infinite);
_stream.BeginRead(_buffer, 0, BufferSize, s_onreadCallback, this); _stream.BeginRead(_buffer, 0, BufferSize, s_onreadCallback, this);
} }
catch catch
{ {
//_timer.Change(Timeout.Infinite, Timeout.Infinite);
CloseSocket(); CloseSocket();
Unbind(); Unbind();
} }
@ -216,7 +208,6 @@ namespace SocketHttpListener.Net
private void OnReadInternal(IAsyncResult ares) private void OnReadInternal(IAsyncResult ares)
{ {
//_timer.Change(Timeout.Infinite, Timeout.Infinite);
int nread = -1; int nread = -1;
try try
{ {

View File

@ -24,7 +24,6 @@ namespace SocketHttpListener
{ {
#region Private Fields #region Private Fields
private string _base64Key;
private Action _closeContext; private Action _closeContext;
private CompressionMethod _compression; private CompressionMethod _compression;
private WebSocketContext _context; private WebSocketContext _context;
@ -35,20 +34,12 @@ namespace SocketHttpListener
private object _forMessageEventQueue; private object _forMessageEventQueue;
private object _forSend; private object _forSend;
private const string _guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; private const string _guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
private Func<WebSocketContext, string>
_handshakeRequestChecker;
private Queue<MessageEventArgs> _messageEventQueue; private Queue<MessageEventArgs> _messageEventQueue;
private uint _nonceCount;
private string _origin;
private bool _preAuth;
private string _protocol; private string _protocol;
private string[] _protocols;
private Uri _proxyUri;
private volatile WebSocketState _readyState; private volatile WebSocketState _readyState;
private AutoResetEvent _receivePong; private AutoResetEvent _receivePong;
private bool _secure; private bool _secure;
private Stream _stream; private Stream _stream;
private Uri _uri;
private const string _version = "13"; private const string _version = "13";
#endregion #endregion