Repository navigation
Conversation
…context WinHttpSendRequest assigned its dwContext to the request unconditionally, so a client that set the context with WINHTTP_OPTION_CONTEXT_VALUE and sent with 0 got 0 back from WinHttpQueryOption and in its REQUEST_ERROR and HANDLE_CLOSING callbacks. The host's winhttp.dll (Windows 11, asynchronous session, loopback) keeps the option's value in all three. A nonzero dwContext still replaces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 86be100 on Windows 11 (26200), MSVC (VS 2022 Build Tools) RelWithDebInfo; the test needs no GPU, but it ran under each GPU selection (RTX 5080 driver 616.92, Radeon gfx1036 driver 26.10.1):
So the 4 new checks passed in all 22 runs. No negative control run. AI-assisted. |
kacper-serewis
left a comment
There was a problem hiding this comment.
Integrated 86be100 and #3682 at 0f83451 privately. All four synthetic Windows combinations passed. A zero send context preserved the inherited or explicitly configured value and a nonzero send replaced either. WinHttpQueryOption, REQUEST_ERROR and HANDLE_CLOSING each reported the expected value in every case.
Kam471
left a comment
There was a problem hiding this comment.
Tested 86be100f on Windows 11, MSVC 19.44.35228 + Ninja, RelWithDebInfo.
winhttp_offline_test.exe-> 54 checks, 0 failures, exit 0.ctest -R winhttp --output-on-failure-> 1/1 passed, 0.02 s.
The new case is present in the pass output ("PASS with the context the request was sent with") and the asynchronous callback cases still report the expected context and a single HANDLE_CLOSING. The change is scoped to dwContext == 0 keeping the option's stored value; a nonzero value still replaces it. No game files.
Note only: main now also changes winhttp_offline.cpp for header/timeout parity (4c52ce27), so this branch will need a rebase before merge; the context behavior itself is independent.
|
PASS. Minor: no case combines a pre-set option with a nonzero send in one block, so "nonzero replaces" is not contrasted directly. Approve. AI-assisted review, no game files, no GPU. |
|
Tested 86be100 merged onto main 03b09a0 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:
AI-assisted (Claude Code). |
Claim: #3796 (comment) (new RT item, offline WinHTTP)
What.
send_requestinruntime/shims/winhttp_offline.cppwrote itsdwContextto the request unconditionally. A client that sets its context withWINHTTP_OPTION_CONTEXT_VALUEand then callsWinHttpSendRequest(..., 0)got 0 back fromWinHttpQueryOption, and 0 in itsREQUEST_ERRORandHANDLE_CLOSINGcallbacks. Now a context of 0 leaves the stored one alone; a nonzero context still replaces it.How it was measured. A small probe against the host's
winhttp.dll(Windows 11 Home 26200; asynchronous session, request to 127.0.0.1 port 1, nothing leaves the machine): afterWinHttpSetOption(request, WINHTTP_OPTION_CONTEXT_VALUE, 0xBBB)andWinHttpSendRequest(request, ..., 0), every callback (RESOLVING_NAME,NAME_RESOLVED,CONNECTING_TO_SERVER,REQUEST_ERROR,HANDLE_CLOSING) carried 0xBBB andWinHttpQueryOptionreturned 0xBBB.Effect on the game: unproven.
docs/runtime_imports.mdsays the package's DLLs pass their context throughWinHttpSendRequest. This PR only makes the stub match WinHTTP for a client that sets it by option.Changes
runtime/shims/winhttp_offline.cpp:send_requestkeeps the stored context when it is given 0; the header comment says so.runtime/test/winhttp_offline_test.cpp: a new block of 4 checks. A synchronous session checksWinHttpQueryOption. An asynchronous request with its own callback checksREQUEST_ERROR,WinHttpQueryOptionandHANDLE_CLOSING. The block has its own callback and events and does not touch the TEST-721 blocks or their waits.docs/runtime_imports.md: one sentence.Tests (Windows 11, MSVC 19.4x, Visual Studio CMake 3.31 + Ninja, RelWithDebInfo):
winhttp_offline_testonmain's shim with the new test: 54 checks, 4 failures (all four new checks). With the fix: 54 checks, 0 failures.winhttp_offlinerun whose only FAIL lines are those three (every handle reports HANDLE_CLOSING once,closing the request inside the callback ...,notifications not asked for ...) is TEST-721, not this change.cteston this head: 153 of 153 passed (18 skipped for lack of game files or a GPU feature, 1 disabled).winhttp_offline_testgives 64 checks, 0 failures.AI-assisted (Claude Code).
🤖 Generated with Claude Code