rethinkdb / rethinkdb-java

Official RethinkDB Java client
https://rethinkdb.com/api/java/
Apache License 2.0
21 stars 10 forks source link

Rewrite readCString to avoid possible handshake hanging #31

Closed NotJustAnna closed 4 years ago

NotJustAnna commented 4 years ago

Default readCString implementation can hang even with timeout due to the blocking InputStream#read before any timeout check. The method was rewritten to fix this.

Method was rewritten based on this StackOverflow answer.