Skip to content

Commit

Permalink
Remove string hardcoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-GS committed Nov 15, 2024
1 parent 434e533 commit 025741e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cs/tool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static unsafe void Main(string[] args)
}

var ApiTable = MsQuic.Open();
const string DomainName = "google.com";
QUIC_HANDLE* registration = null;
QUIC_HANDLE* configuration = null;
QUIC_HANDLE* connection = null;
Expand All @@ -55,7 +56,7 @@ static unsafe void Main(string[] args)
MsQuic.ThrowIfFailure(ApiTable->ConfigurationLoadCredential(configuration, &config));
MsQuic.ThrowIfFailure(ApiTable->ConnectionOpen(registration, &NativeCallback, ApiTable, &connection));
sbyte* google = stackalloc sbyte[50];
int written = Encoding.UTF8.GetBytes("google.com", new Span<byte>(google, 50));
int written = Encoding.UTF8.GetBytes(DomainName, new Span<byte>(google, 50));
google[written] = 0;
MsQuic.ThrowIfFailure(ApiTable->ConnectionStart(connection, configuration, 0, google, 443));
Thread.Sleep(1000);
Expand Down

0 comments on commit 025741e

Please sign in to comment.