Merge pull request #441 from NJDFan/master

reset_input_buffer() can hang on sockets