From f5ae3668196917197a40f343c844791b7d41ee08 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Tue, 1 Dec 2026 05:34:39 +0800 Subject: [PATCH] 0.3.6: Winsock is started at the first socket (#26) --- CHANGELOG.md | 20 ++++++++++++++++++++ README.md | 4 ++-- mcpp.toml | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcd7dcf..8a6300a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 0.3.6 + +On Windows every request works again. It is a patch release, so a dependency +written as a caret range, `tinyhttps = "^0.3.1"`, resolves to it. + +### Winsock is started at the first socket + +[#26](https://github.com/mcpplibs/tinyhttps/pull/26). `Socket::platform_init()` +(WSAStartup) existed and was never called. On Windows the first `connect` then +ran `socket()` and `getaddrinfo()` with Winsock unstarted, and every request +ended in `statusCode = 0`, `statusText = "Connection failed"`, with nothing +saying why. + +* `Socket::ensure_platform_started()` runs once per process at the top of + `Socket::connect`, before the first `socket()` or `getaddrinfo()`; + `Socket::platform_started()` says whether it ran. +* `platform_init()` is unchanged and still public. +* `tests/test_winsock_start.cpp` is the first socket of its process and checks + both. + ## 0.3.5 A handshake that never completes no longer holds a request for good, and a diff --git a/README.md b/README.md index 6ee907d..ad576f0 100644 --- a/README.md +++ b/README.md @@ -214,14 +214,14 @@ Windows). Locally, ### 添加依赖 ```bash -mcpp add tinyhttps@0.3.5 +mcpp add tinyhttps@0.3.6 ``` 或在 `mcpp.toml` 中手动添加: ```toml [dependencies] -tinyhttps = "0.3.5" +tinyhttps = "0.3.6" ``` ### 构建 diff --git a/mcpp.toml b/mcpp.toml index 911b9b3..68a00c2 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -1,7 +1,7 @@ [package] namespace = "mcpplibs" name = "tinyhttps" -version = "0.3.5" +version = "0.3.6" description = "Minimal C++23 HTTP/HTTPS client with SSE streaming support" license = "Apache-2.0" repo = "https://github.com/mcpplibs/tinyhttps"