MINOR: stream: Handle stream's timeouts in a dedicated function

This will be mandatory to be able to handle stream's timeouts before exiting
process_stream(). So, to not duplicate code, all this stuff is moved in a
dedicated function.
1 file changed