Small cleanup to SocketOutput's shutdown logic
This commit is contained in:
parent
07744e75d9
commit
6bff2ecb34
|
|
@ -248,7 +248,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
|
|
||||||
public void ProducingComplete(MemoryPoolIterator end)
|
public void ProducingComplete(MemoryPoolIterator end)
|
||||||
{
|
{
|
||||||
if(_lastStart.IsDefault)
|
if (_lastStart.IsDefault)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -560,7 +560,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
|
|
||||||
public int WriteStatus;
|
public int WriteStatus;
|
||||||
public Exception WriteError;
|
public Exception WriteError;
|
||||||
public int ShutdownSendStatus;
|
|
||||||
|
|
||||||
public WriteContext(SocketOutput self)
|
public WriteContext(SocketOutput self)
|
||||||
{
|
{
|
||||||
|
|
@ -625,15 +624,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
|
|
||||||
var shutdownReq = new UvShutdownReq(Self._log);
|
var shutdownReq = new UvShutdownReq(Self._log);
|
||||||
shutdownReq.Init(Self._thread.Loop);
|
shutdownReq.Init(Self._thread.Loop);
|
||||||
shutdownReq.Shutdown(Self._socket, (_shutdownReq, status, state) =>
|
shutdownReq.Shutdown(Self._socket, (req, status, state) =>
|
||||||
{
|
{
|
||||||
_shutdownReq.Dispose();
|
req.Dispose();
|
||||||
var _this = (WriteContext)state;
|
|
||||||
_this.ShutdownSendStatus = status;
|
|
||||||
|
|
||||||
_this.Self._log.ConnectionWroteFin(_this.Self._connectionId, status);
|
var writeContext = (WriteContext)state;
|
||||||
|
writeContext.Self._log.ConnectionWroteFin(writeContext.Self._connectionId, status);
|
||||||
_this.DoDisconnectIfNeeded();
|
writeContext.DoDisconnectIfNeeded();
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -762,8 +759,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http
|
||||||
|
|
||||||
WriteStatus = 0;
|
WriteStatus = 0;
|
||||||
WriteError = null;
|
WriteError = null;
|
||||||
|
|
||||||
ShutdownSendStatus = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -683,7 +683,6 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
Assert.True(start.IsDefault);
|
Assert.True(start.IsDefault);
|
||||||
// ProducingComplete should not throw given a default iterator
|
// ProducingComplete should not throw given a default iterator
|
||||||
socketOutput.ProducingComplete(start);
|
socketOutput.ProducingComplete(start);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue