Skip to content

ezhttp_create_options default auto destroyed, tests, fix fall back silently to the main queue#37

Merged
Polarhigh merged 2 commits intoNext21Team:mainfrom
wilianmaique:main
Apr 25, 2026
Merged

ezhttp_create_options default auto destroyed, tests, fix fall back silently to the main queue#37
Polarhigh merged 2 commits intoNext21Team:mainfrom
wilianmaique:main

Conversation

@wilianmaique
Copy link
Copy Markdown
Contributor

Improve the lifecycle of EzHttpOptions, remove silent fallbacks that were hiding usage errors, and make the tests more reliable.

What was updated

  • ezhttp_create_options() now accepts auto_destroy, with the default value set to true.
  • The default behavior remains compatible with the previous usage: if the user does not want to reuse the options handle, nothing changes.
  • If the user wants to reuse the same options handle, it can now be created with ezhttp_create_options(false) or .auto_destroy = false.
  • Automatic cleanup was implemented in a safe way, including scenarios where more than one request is using the same options handle.

What was improved

  • Invalid queue ids no longer fall back silently to the main queue.
  • Invalid plugin_end_behaviour values are no longer accepted silently.
  • Invalid EzHttpFtpSecurity values now fail explicitly with a native error.
  • Invalid request methods no longer fall back implicitly to GET.
  • In short: invalid usage now fails clearly instead of looking like it "worked".

Test improvements

  • Tests were added for reusing options with and without auto_destroy.
  • Tests were added to validate rejection of invalid settings in the module.
  • The FTP wildcard test now cleans up the directory by enumerating the actual downloaded files.
  • This fixes the case where the FTP mirror adds new files, such as hello-2.12.3.tar.gz.sig, and the directory was left behind.

Documentation

  • README.md and easy_http.inc were updated with the new auto_destroy option.
  • The documentation now makes it clearer when the behavior is automatic and when the user must clean up manually.
  • It also documents that invalid values in relevant enums raise native errors.

@Polarhigh Polarhigh merged commit 4b7c2a0 into Next21Team:main Apr 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants