Closed kayceesrk closed 8 years ago
Thanks.
Tell me if you have other problems with it, I'll make a new release once you're happy with it.
Excellent. Thanks for merging.
I haven't encountered any further problems. I think it is good to go for a new release.
On 26/07/2016 10:56, KC Sivaramakrishnan wrote:
I haven't encountered any further problems. I think it is good to go for a new release.
Done. Thanks :)
Cohttp input stream reads may return less than the requested number of bytes [0]. The PR fixes the use of
read
in websocket core by replacing them withread_exactly
which attempts to read exactly the requested number of bytes (and returnsNone
if such a read is not possible).This PR fixes a bug with the slackbot that I'm writing (will file an issue once I clean up the test case). The summary is that the header reads in
make_read_frame
causesInvalid_argument "index out of bounds"
exception since only 1 byte was read, whereas the continuation expects 2 bytes [1].Happy to take comments on improving the PR.
[0] https://github.com/mirage/ocaml-cohttp/blob/5c68585259ef4d5a2bf9c2250cbadfae94704241/lib/s.mli#L51-L54 [1] https://github.com/vbmithr/ocaml-websocket/blob/master/lib/websocket.ml#L163-L167