Skip to content

Commit df30ff8

Browse files
authored
improve debuging HTTP/2 tests (#94530)
* improve debuging HTTP/2 tests * line * feedback
1 parent 2146139 commit df30ff8

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ private static unsafe void KeyLogCallback(IntPtr ssl, char* line)
805805
{
806806
s_fileStream.Write(data);
807807
s_fileStream.WriteByte((byte)'\n');
808+
s_fileStream.Flush();
808809
}
809810
}
810811
}

src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public void Close()
9494
CloseWebSocket();
9595
}
9696

97+
public EndPoint? LocalEndPoint => _socket?.LocalEndPoint;
98+
public EndPoint? RemoteEndPoint => _socket?.RemoteEndPoint;
99+
97100
public async Task WaitForCloseAsync(CancellationToken cancellationToken)
98101
{
99102
while (_websocket != null

src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ private Http2LoopbackConnection(SocketWrapper socket, Stream stream, TimeSpan ti
4343
_transparentPingResponse = transparentPingResponse;
4444
}
4545

46+
public override string ToString()
47+
{
48+
return $"{this.GetType().Name} {_connectionSocket.LocalEndPoint} <-> {_connectionSocket.RemoteEndPoint}";
49+
}
50+
4651
public static Task<Http2LoopbackConnection> CreateAsync(SocketWrapper socket, Stream stream, Http2Options httpOptions)
4752
{
4853
return CreateAsync(socket, stream, httpOptions, Http2LoopbackServer.Timeout);

0 commit comments

Comments
 (0)