anmonteiro / anmonteiro/httpun-ws
How to report an exception while reading a handshake failure response
- Lingua principale
- OCaml
- Stelle
- 29
- Fork
- 16
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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 n`Httpaf.Client_connection.t`. However, it doesn't seem possible to get either `Client_connection.t` at this point.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.