Skip to content

Replace state polling with return values from receive, read, and send - #152

Merged
SeanTAllen merged 1 commit into
mainfrom
tell-dont-ask
Aug 6, 2026
Merged

Replace state polling with return values from receive, read, and send#152
SeanTAllen merged 1 commit into
mainfrom
tell-dont-ask

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

receive(), read(), and send() now return what happened instead of requiring the caller to poll state() afterwards. state(), can_send(), SSLState, SSLHandshake, and SSLDisposed are removed.

receive() returns SSLReceiveResultSSLReceiveOK when data was accepted with nothing else to report, SSLReady when the handshake completes, SSLAuthFail or SSLError on failure. read() returns SSLReadResult — application data, None, SSLClosed, or SSLError. send() returns (Array[U8] iso^ | None) and no longer raises.

SSLConnection uses return values from each operation to drive its callbacks instead of polling state.

Closes #150

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Aug 5, 2026
SeanTAllen added a commit that referenced this pull request Aug 5, 2026
@SeanTAllen

SeanTAllen commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

No outstanding parked items.

SeanTAllen added a commit that referenced this pull request Aug 5, 2026
PR #152's Changed entry covers SSLClosed as a read() return value.
The internal OpenSSL constant doesn't belong in user-facing text.
receive(), read(), and send() now return what happened instead of
requiring the caller to poll state() afterwards. state(), can_send(),
SSLState, SSLHandshake, and SSLDisposed are removed.

InvalidOperation signals a call on a session that is no longer
operational (disposed). SSLReceiveOK is renamed to SSLAccepted.

Closes #150
@SeanTAllen
SeanTAllen merged commit 8453958 into main Aug 6, 2026
13 checks passed
@SeanTAllen
SeanTAllen deleted the tell-dont-ask branch August 6, 2026 00:30
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Aug 6, 2026
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.

Remove state() and can_send() from SSL

2 participants