Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.9.3 (2019-01-07)

* tls: do not require client sent ciphersuites to be a proper set
(interoperability with some android devices)
* tls_lwt: delay error from writing to peer while reading, record errors only
if state is active (fixes #347)
* migrate opam file to opam 2.0 format

## 0.9.2 (2018-08-24)

* compatibility with ppx_sexp_conv >v0.11.0 (#381), required for 4.07.0
Expand Down
8 changes: 5 additions & 3 deletions lwt/tls_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ module Unix = struct
let recording_errors op t cs =
Lwt.catch
(fun () -> op t.fd cs)
(fun exn ->
t.state <- `Error exn ;
(fun exn -> (match t.state with
| `Error _ | `Eof -> ()
| `Active _ -> t.state <- `Error exn) ;
fail exn)
in
(recording_errors Lwt_cs.read, recording_errors Lwt_cs.write_full)
Expand All @@ -82,7 +83,8 @@ module Unix = struct
| `Alert a -> `Error (Tls_alert a)
in
t.state <- state' ;
(resp |> when_some (write_t t)) >>= fun () -> return (`Ok data)
safely (resp |> when_some (write_t t)) >|= fun () ->
`Ok data

| `Fail (alert, `Response resp) ->
t.state <- `Error (Tls_failure alert) ;
Expand Down