Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to report an exception while reading a handshake failure response #40

Open
Tracked by #181
aantron opened this issue Jan 22, 2022 · 0 comments
Open
Tracked by #181

Comments

@aantron
Copy link

aantron commented Jan 22, 2022

The Lwt client type, Websocketaf_lwt*.Client.t is abstract:

https://github.com/anmonteiro/websocketaf/blob/248a2cb0dcffa51996c3ad7643577dce75d67454/lwt/websocketaf_lwt_intf.ml#L51

and not made concrete in either Websocketaf_lwt or Websocketaf_lwt_unix, and there seem to be no accessors for extracting either a Websocketaf.Client_connection.t or Httpaf.Client_connection.t from it. After receiving a `Handshake_failure response,

https://github.com/anmonteiro/websocketaf/blob/248a2cb0dcffa51996c3ad7643577dce75d67454/lib/websocketaf.mli#L184-L186

which is an ordinary situation in case of 3xx redirect, a client written over websocket/af will "want" to treat the response as if it is an HTTP/1 client using http/af. In particular, if it needs to abort body reading with an exception, it will want to call report_exn, which is available on Websocketaf.Client_connection.t:

https://github.com/anmonteiro/websocketaf/blob/248a2cb0dcffa51996c3ad7643577dce75d67454/lib/websocketaf.mli#L219

and a similar function is available o nHttpaf.Client_connection.t. However, it doesn't seem possible to get either Client_connection.t at this point.

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

No branches or pull requests

1 participant