Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 8f52c16

Browse files
committed
PR Comments
Following PR comments were addressed: *. curl_version_info_data is defined till the required field *. the fields were made readonly.
1 parent 20eea48 commit 8f52c16

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/Common/src/Interop/Unix/libcurl/Interop.libcurl_types.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,16 @@ internal struct CURLMsg
163163
internal int result;
164164
}
165165

166-
// Curl Version Information
167-
[StructLayout(LayoutKind.Explicit)]
166+
// NOTE: The definition of this structure in Curl/curl.h is larger than
167+
// than what is defined below. This definition is only valid for use with
168+
// Marshal.PtrToStructure and not for general use in P/Invoke signatures.
169+
[StructLayout(LayoutKind.Sequential)]
168170
internal struct curl_version_info_data
169171
{
170-
[FieldOffset(0)]
171172
internal int age;
172-
[FieldOffset(32)]
173+
private unsafe char *version;
174+
private int versionNum;
175+
private unsafe char *host;
173176
internal int features;
174177
}
175178

src/System.Net.Http/src/System/Net/Http/Unix/CurlHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ internal partial class CurlHandler : HttpMessageHandler
4848

4949
#region Fields
5050

51-
private static bool _supportsAutomaticDecompression;
52-
private static bool _supportsSSL;
51+
private static readonly bool _supportsAutomaticDecompression;
52+
private static readonly bool _supportsSSL;
5353
private volatile bool _anyOperationStarted;
5454
private volatile bool _disposed;
5555
private IWebProxy _proxy = null;

0 commit comments

Comments
 (0)