Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
more HTTP/2 PING logging
  • Loading branch information
antonfirsov authored and github-actions committed Aug 23, 2021
commit fbaf90b89c52634a50f6591d920e8c3b1f942106
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ private void ProcessPingFrame(FrameHeader frameHeader)
ReadOnlySpan<byte> pingContent = _incomingBuffer.ActiveSpan.Slice(0, FrameHeader.PingLength);
long pingContentLong = BinaryPrimitives.ReadInt64BigEndian(pingContent);

if (NetEventSource.Log.IsEnabled()) Trace($"Received PING frame, content:{pingContentLong} ack: {frameHeader.AckFlag}");

if (frameHeader.AckFlag)
{
ProcessPingAck(pingContentLong);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ internal void OnDataOrHeadersReceived(Http2Connection connection)

// Send a PING
_pingCounter--;
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Sending RTT PING with payload {_pingCounter}");
connection.LogExceptions(connection.SendPingAsync(_pingCounter, isAck: false));
_pingSentTimestamp = now;
_state = State.PingSent;
Expand All @@ -223,6 +224,7 @@ internal void OnPingAckReceived(long payload, Http2Connection connection)
{
if (_state != State.PingSent && _state != State.TerminatingMayReceivePingAck)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Unexpected PING ACK in state {_state}");
ThrowProtocolError();
}

Expand All @@ -236,7 +238,10 @@ internal void OnPingAckReceived(long payload, Http2Connection connection)
Debug.Assert(payload < 0);

if (_pingCounter != payload)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Unexpected RTT PING ACK payload {payload}, should be {_pingCounter}.");
ThrowProtocolError();
}

RefreshRtt(connection);
_state = State.Waiting;
Expand Down