Skip to content

Commit f81b450

Browse files
committed
Pass hostname length to SharedDnsResolverCallbackAsync
1 parent 26b184d commit f81b450

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

SharedStatic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace Hi3Helper.Plugin.Core;
4242
/// <param name="hostname">[In] A hostname to query the A/AAAA record to.</param>
4343
/// <param name="cancelCallback">[Out] A callback in which invoked, will be cancelling the async operation of the resolver.</param>
4444
/// <returns>A pointer to <see cref="ComAsyncResult"/> in which returns the pointer (<see cref="nint"/>) of the <see cref="DnsARecordResult"/> struct.</returns>
45-
public unsafe delegate nint SharedDnsResolverCallbackAsync(char* hostname, void** cancelCallback);
45+
public unsafe delegate nint SharedDnsResolverCallbackAsync(char* hostname, int hostnameLength, void** cancelCallback);
4646

4747
/// <summary>
4848
/// An action delegate. This is equivalent to <see cref="Action"/> delegate.

Utility/PluginHttpClientBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ unsafe nint GetAsyncResultPointer(out VoidCallback cancelTriggerCallback)
432432
// Get the pointer of the string to pass it into the callback, then get the pointer of the cancel callback.
433433
char* hostP = host.GetPinnableStringPointer();
434434
void* cancelCallbackP = null;
435-
nint asyncResultP = SharedStatic.InstanceDnsResolverCallbackAsync(hostP, &cancelCallbackP);
435+
nint asyncResultP = SharedStatic.InstanceDnsResolverCallbackAsync(hostP, host.Length, &cancelCallbackP);
436436

437437
// SANITY: Throw if both pointer to ComAsyncResult and cancel callback are null.
438438
if (asyncResultP == 0)

0 commit comments

Comments
 (0)