stream_wrap: limit accepted buffer to proper size