bugfix: only recv() more data when required