tests/server: tidy-up error messages (Windows)

- show error description on `PeekNamedPipe()` error.
- show `GetLastError()` instead of socket error on non-socket failures
  in the window handler.
- include full hex `GetLastError()` numbers in error messages, syncing
  with Schannel code.
- drop internal `win32_perror()` function, in favor of direct
  `curlx_*strerror()` calls.

Closes #20477
This commit is contained in:
Viktor Szakats 2026-01-29 20:54:17 +01:00
parent 4d0c3b690e
commit 373e89a021
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 20 additions and 18 deletions

View file

@ -526,7 +526,10 @@ static DWORD WINAPI select_ws_wait_thread(void *lpParameter)
/* if the pipe has NOT been closed, sleep and continue waiting */
ret = GetLastError();
if(ret != ERROR_BROKEN_PIPE) {
logmsg("[select_ws_wait_thread] PeekNamedPipe error (%lu)", ret);
char buffer[WINAPI_ERROR_LEN];
curlx_winapi_strerror(ret, buffer, sizeof(buffer));
logmsg("[select_ws_wait_thread] PeekNamedPipe error: (0x%08lx) - %s",
ret, buffer);
SleepEx(0, FALSE);
continue;
}