[OPTIM] stream_sock: factor out the buffer full handling out of the loop

Handling the buffer full condition is not trivial and this code was
duplicated inside the loop. Move it out of the loop at a single place.
1 file changed