Make buffered_line_reader handle CRLF; also let it read specified size buffers
commit458a444afc9f0ab0a309f09372423e56c974b689
authorLucian Wischik <ljw@fb.com>
Thu, 9 Mar 2017 18:31:16 +0000 (9 10:31 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 9 Mar 2017 18:38:35 +0000 (9 10:38 -0800)
treedf993770c86500726c25976f909a4b963ab3a0ba
parentb52aac9732c59e4303ccf2d25a9ceeaad99806ec
Make buffered_line_reader handle CRLF; also let it read specified size buffers

Summary:
LSP uses internet-convention line ending "CRLF"
https://www.rfc-editor.org/old/EOLstory.txt
http://stackoverflow.com/questions/17262779/why-does-http-use-crlf-as-line-delimiter

It also uses a http-style "Content-length" header, and delivers that many bytes for the message body with no further delimiter.

I amended the "buffered_line_reader" code to handle both things.

Reviewed By: arxanas

Differential Revision: D4622687

fbshipit-source-id: 6900f262e3810953227da2ecea9680d81ad56205
hphp/hack/src/utils/buffered_line_reader.ml
hphp/hack/src/utils/buffered_line_reader.mli
hphp/hack/test/unit/utils/buffered_line_reader_test.ml [new file with mode: 0644]