Skip to content

refactor(tls): remove redundant Wasm connection null checks - #611

Merged
Guest0x0 merged 1 commit into
moonbitlang:mainfrom
peter-jerry-ye:codex/tls-remove-null-checks
Sep 17, 2026
Merged

Guest0x0 merged 1 commit into
moonbitlang:mainfrom
peter-jerry-ye:codex/tls-remove-null-checks

Conversation

@peter-jerry-ye

Copy link
Copy Markdown
Contributor

The Wasm TLS wrapper checks connection handles against literal zero, although tls/connection/new returns a live pending object. TLS initialization happens in the client and server setup calls, which report failures through a status and the object's error message. The null check and global-error path therefore cannot handle a constructor failure.

Call the constructor and free import directly, remove the unused connection-null and global-error helpers, and document the constructor contract. This changes one Wasm implementation file and preserves the public API, setup error handling, and null checks for certificate and channel-binding buffers.

Companion cleanup for moonbitlang/moon#2222. Merge the Moonrun change first; existing guest wrappers work with it, and the simplified wrapper uses the same constructor and cleanup imports.

@Guest0x0
Guest0x0 merged commit 136c31d into moonbitlang:main Sep 17, 2026
21 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