Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
7b43dd4
fix: guard HAVE_MAT_LIVEEVENTINSPECTOR/PRIVACYGUARD against redefinition
bmehta001 Jun 10, 2026
fc7375a
fix: prevent EDEADLK self-join in ~CurlHttpOperation on async-thread …
bmehta001 Jun 11, 2026
e76fabf
Merge branch 'main' into bhamehta/fix-curl-async-self-join
bmehta001 Jun 11, 2026
3554d8d
Make ~CurlHttpOperation detach conditional on self-join (fix UAF regr…
bmehta001 Jun 13, 2026
b10fa89
Address Copilot round 2 on #1481: include <new>, handle nothrow-new f…
bmehta001 Jun 13, 2026
3dda53b
Address Copilot round 3 on #1481: avoid atomic<thread::id>, fix lifet…
bmehta001 Jun 13, 2026
7e22ed2
Address Copilot round 4 on #1481: precise self-join comment, reset fl…
bmehta001 Jun 13, 2026
dcbc2a2
Merge branch 'main' into bhamehta/fix-curl-async-self-join
bmehta001 Jun 30, 2026
7a14e76
Merge branch 'main' into bhamehta/fix-curl-async-self-join
bmehta001 Jul 8, 2026
6bf8f55
Merge remote-tracking branch 'origin/main' into bhamehta/fix-curl-asy…
bmehta001 Jul 8, 2026
150e376
Replace std::async with a self-keepalive detached worker (real fix fo…
bmehta001 Jul 8, 2026
854f2dd
Merge remote-tracking branch 'fork/bhamehta/fix-curl-async-self-join'…
bmehta001 Jul 8, 2026
a12525e
Address Copilot round on #1481: own the body, catch worker exceptions…
bmehta001 Jul 8, 2026
23486a6
Address Copilot round 2 on #1481: move body, deterministic test host,…
bmehta001 Jul 8, 2026
4ccc9ea
Address Copilot round 3 on #1481: guard worker-thread start, harden t…
bmehta001 Jul 8, 2026
f9262e0
Address Copilot round 5 on #1481: <limits> include, broaden thread-st…
bmehta001 Jul 9, 2026
a1da06f
Address Copilot round 6 on #1481: guard shared_from_this() in SendAsync
bmehta001 Jul 9, 2026
23b6f9a
Correct the body-move comment in SendRequestAsync (#1481 review round 7)
bmehta001 Jul 9, 2026
62395c7
Harden NoSelfJoin test timeout path (#1481 review round 8)
bmehta001 Jul 9, 2026
9ae7dd5
Move worker-lambda construction inside the try in SendAsync (#1481 re…
bmehta001 Jul 9, 2026
1ff4b52
Drop issue-number references from code comments
bmehta001 Jul 9, 2026
b1e03d8
Guarantee the callback fires even when Send() throws
bmehta001 Jul 9, 2026
cf9bc95
Fix use-after-free dispatching OnDestroy after the completion callback
bmehta001 Jul 10, 2026
f2af5ec
Address review: include <utility>, correct OnDestroy comment, harden …
bmehta001 Jul 10, 2026
4af8401
Fix two curl-client lifetime issues found in review
bmehta001 Jul 10, 2026
89491fd
Harden curl-client shutdown: complete-on-send and skip unsafe global …
bmehta001 Jul 10, 2026
9d69b19
Harden the completion-guard regression test against the timeout path
bmehta001 Jul 10, 2026
bfabf8c
Clarify ~CurlHttpOperation comment for never-sent and synchronous-fal…
bmehta001 Jul 10, 2026
e25c43c
Correct the OnDestroy comment: suppressed once a send is attempted
bmehta001 Jul 10, 2026
8e6575b
Wait for the operation to be destroyed in the self-join test's timeou…
bmehta001 Jul 10, 2026
d2c69dd
Wait for the operation to be destroyed on the self-join test's succes…
bmehta001 Jul 10, 2026
8650ce1
Guarantee async ops are destroyed before teardown in both self-join t…
bmehta001 Jul 10, 2026
bd49de4
Hard-stop if a detached curl worker refuses to drain before teardown
bmehta001 Jul 10, 2026
42d448c
Fix curl worker shutdown lifetime
bmehta001 Jul 13, 2026
6b793ad
Simplify curl worker lifetime handling
bmehta001 Jul 30, 2026
88f5c8f
Preserve curl completion semantics on worker failures
bmehta001 Jul 30, 2026
48ad566
Merge microsoft/main into the curl self-join fix
bmehta001 Jul 30, 2026
6a1c050
Default Win32 desktop transport to WinHTTP instead of WinInet
bmehta001 Aug 1, 2026
e28ae45
fix winhttp teardown hang on cancellation
bmehta001 Aug 3, 2026
b73beec
Merge branch 'main' into bhamehta/winhttp-default-windows-transport
bmehta001 Aug 3, 2026
2ef5a64
Merge branch 'main' into bhamehta/winhttp-default-windows-transport
bmehta001 Aug 4, 2026
035d2d4
Fix WinHTTP cancellation completion race
bmehta001 Aug 4, 2026
f227d3f
Merge branch 'main' into bhamehta/winhttp-default-windows-transport
bmehta001 Aug 5, 2026
287dbc8
Join stress-test upload workers before teardown
bmehta001 Aug 5, 2026
f7fb6f4
Prevent WinHTTP request wrapper use-after-free
bmehta001 Aug 5, 2026
b2bd27b
Align vcpkg iOS deployment target
bmehta001 Aug 6, 2026
ca440fc
Harden Apple packaging integration
bmehta001 Aug 6, 2026
c96f7de
Migrate Apple builds to canonical CMake variables
bmehta001 Aug 7, 2026
50d283a
Remove unused Windows transport dependencies
bmehta001 Aug 7, 2026
ba35371
Merge branch 'main' into bhamehta/winhttp-default-windows-transport
bmehta001 Aug 7, 2026
715800d
Merge remote-tracking branch 'origin/main' into bhamehta/winhttp-defa…
bmehta001 Aug 8, 2026
85116f0
Merge branch 'main' into bhamehta/fix-curl-async-self-join
bmehta001 Aug 8, 2026
aa80a93
Fix WinHTTP duplicate completion during teardown
bmehta001 Aug 8, 2026
6deff3f
Merge remote-tracking branch 'origin/bhamehta/winhttp-default-windows…
bmehta001 Aug 8, 2026
927515f
Merge upstream main after PR 1511
bmehta001 Aug 8, 2026
d952202
Keep WinHTTP callback context alive through close
bmehta001 Aug 8, 2026
da1fe11
Make cancellation stress test deterministic
bmehta001 Aug 8, 2026
0303c83
Avoid fixture socket overflow in cancellation stress test
bmehta001 Aug 8, 2026
f03af17
Prepare WinHTTP for bounded cancellation
bmehta001 Aug 8, 2026
38d1e21
Merge PR 1481 Curl lifetime fix
bmehta001 Aug 8, 2026
2a1823c
Align bounded cancellation integration
bmehta001 Aug 8, 2026
4c8d94c
Prepare request draining for PR 1494
bmehta001 Aug 8, 2026
9bd4ae2
Merge branch 'main' into bhamehta/winhttp-default-windows-transport
bmehta001 Aug 8, 2026
8b38be1
Fix teardown deadlock when flush is skipped during pause
bmehta001 Aug 9, 2026
9d1b3ec
Merge remote-tracking branch 'origin/bhamehta/winhttp-default-windows…
bmehta001 Aug 9, 2026
8d3b67a
Fix process-terminating fastfail in oneds_memcpy_s on MSVC
bmehta001 Aug 9, 2026
0104294
Select curl HTTP version at runtime instead of forcing HTTP/2
bmehta001 Aug 9, 2026
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
10 changes: 9 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,17 @@ target_compile_definitions(matsdk_internal_config INTERFACE
_USRDLL
WINVER=_WIN32_WINNT_WIN7)
target_compile_options(matsdk_internal_config INTERFACE /U_MBCS)
option(MATSDK_USE_WININET
"Use WinInet instead of WinHTTP as the Win32 desktop HTTP client" OFF)
if(MATSDK_USE_WININET)
target_compile_definitions(matsdk_internal_config INTERFACE HAVE_MAT_WININET_HTTP_CLIENT)
endif()
list(APPEND SRCS
http/HttpClient_WinInet.cpp
http/HttpClient_WinInet.hpp
http/HttpClient_WinHttp.cpp
http/HttpClient_WinHttp.hpp
http/IBoundedHttpClientCancel.hpp
pal/desktop/WindowsDesktopDeviceInformationImpl.cpp
pal/desktop/WindowsDesktopNetworkInformationImpl.cpp
pal/desktop/WindowsDesktopSystemInformationImpl.cpp
Expand Down Expand Up @@ -666,7 +674,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
target_link_libraries(mat PUBLIC log)
endif()
elseif(PAL_IMPLEMENTATION STREQUAL "WIN32")
target_link_libraries(mat PUBLIC wininet crypt32 ws2_32)
target_link_libraries(mat PRIVATE wininet winhttp crypt32)
elseif(APPLE)
target_link_libraries(mat PUBLIC
"-framework CoreFoundation"
Expand Down
9 changes: 9 additions & 0 deletions lib/http/HttpClientFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "http/HttpClient_WinRt.hpp"
#elif defined(HAVE_MAT_WININET_HTTP_CLIENT)
#include "http/HttpClient_WinInet.hpp"
#elif defined(HAVE_MAT_WINHTTP_HTTP_CLIENT)
#include "http/HttpClient_WinHttp.hpp"
#endif
#elif defined(MATSDK_PAL_CPP11)
#if TARGET_OS_IPHONE || (defined(__APPLE__) && defined(APPLE_HTTP))
Expand Down Expand Up @@ -49,6 +51,13 @@ namespace MAT_NS_BEGIN {
return std::make_shared<HttpClient_WinInet>();
}

#elif defined(HAVE_MAT_WINHTTP_HTTP_CLIENT)
/* Win32 WinHTTP client (default) */
std::shared_ptr<IHttpClient> HttpClientFactory::Create() {
LOG_TRACE("Creating HttpClient_WinHttp");
return std::make_shared<HttpClient_WinHttp>();
}

#endif
#elif defined(HAVE_MAT_CURL_HTTP_CLIENT)
std::shared_ptr<IHttpClient> HttpClientFactory::Create() {
Expand Down
13 changes: 11 additions & 2 deletions lib/http/HttpClientFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@ class HttpClientFactory

// TODO: [maxgolov] - remove this once there is a better way to pass HTTP client configuration
#if defined(MATSDK_PAL_WIN32) && !defined(_WINRT_DLL)
#define HAVE_MAT_WININET_HTTP_CLIENT
#include "http/HttpClient_WinInet.hpp"
#if defined(HAVE_MAT_WININET_HTTP_CLIENT)
#include "http/HttpClient_WinInet.hpp"
#else
// WinHTTP is the default Win32 desktop transport: unlike WinInet, it does
// not depend on a logged-on interactive user or that user's Internet
// Explorer settings, so it works in services and other non-interactive
// processes without extra configuration. Define HAVE_MAT_WININET_HTTP_CLIENT
// to opt back into WinInet (e.g. for IE-integrated proxy/cookie behavior).
#define HAVE_MAT_WINHTTP_HTTP_CLIENT
#include "http/HttpClient_WinHttp.hpp"
#endif
#endif

#endif // HAVE_MAT_DEFAULT_HTTP_CLIENT
Expand Down
7 changes: 2 additions & 5 deletions lib/http/HttpClient_Curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ namespace MAT_NS_BEGIN {

auto curlOperation = std::make_shared<CurlHttpOperation>(curlRequest->m_method, curlRequest->m_url, callback, requestHeaders, curlRequest->m_body, false, HTTP_CONN_TIMEOUT, m_sslVerify, sslCaInfo);
curlRequest->SetOperation(curlOperation);

// The lifetime of curlOperation is guarnteed by the call to result.wait() in the d'tor.
curlOperation->SendAsync([this, callback, requestId](CurlHttpOperation& operation) {
this->EraseRequest(requestId);

curlOperation->SendAsync([this, callback, requestId](CurlHttpOperation& operation) {
EraseRequest(requestId);
auto response = std::unique_ptr<SimpleHttpResponse>(new SimpleHttpResponse(requestId));
response->m_result = HttpResult_OK;

Expand Down Expand Up @@ -161,4 +159,3 @@ namespace MAT_NS_BEGIN {
} MAT_NS_END

#endif

Loading
Loading