Skip to content

HTTP Client cURL issues - #146

Merged
maciejlew merged 5 commits into
smsapi:masterfrom
maciejlew:http-client-curl-issues
Oct 20, 2026
Merged

maciejlew merged 5 commits into
smsapi:masterfrom
maciejlew:http-client-curl-issues

Conversation

@maciejlew

Copy link
Copy Markdown
Collaborator

Follow-up to #145: curl_close() is now called based on the handle type (is_resource()) instead of the PHP version, and execute() is wrapped in try/finally so the cURL handle is also closed when the request fails on PHP-7. Adds a 4.0.1 CHANGELOG entry covering these fixes and the ones from #145.

Make GitHub Action test workflow pass
Call curl_close() only when the handle is a resource (PHP < 8.0); since PHP 8.0 it is a CurlHandle object freed automatically, and curl_close() is deprecated in PHP 8.5.
Wrap execute() in try/finally so closeHttpClient() also runs when RequestException is thrown, preventing the handle from being left open on PHP < 8.0.
@maciejlew
maciejlew force-pushed the http-client-curl-issues branch from 59e428d to 281f354 Compare October 20, 2026 12:22
@maciejlew
maciejlew merged commit 5cfdd47 into smsapi:master Oct 20, 2026
11 checks passed
@maciejlew
maciejlew deleted the http-client-curl-issues branch October 20, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant