Skip to content

Commit

Permalink
fix keep alive implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimkim committed Oct 10, 2018
1 parent 1236174 commit 266d847
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DotNetty.Codecs.Http/HttpServerKeepAliveHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public override ValueTask WriteAsync(IChannelHandlerContext context, object mess
}
if (message is ILastHttpContent && !this.ShouldKeepAlive())
{
return new ValueTask(base.WriteAsync(context, message).CloseOnComplete(context));
Task task = base.WriteAsync(context, message).AsTask();
task.CloseOnComplete(context.Channel);
return new ValueTask(task);
}
return base.WriteAsync(context, message);
}
Expand Down

0 comments on commit 266d847

Please sign in to comment.