This patch corrects read_handle_data, which calls read_getline overwriting what has already been read from the stream socket. But this does not solve bug 857075 for itself. The last lines in the patch are what should solve it, but there are some other checks that could be made. Perhaps, using select before writing. Something that should block until everything is written. However, this is not interesting, and something more complex should be done, which would allocate a buffer large enough to hold everything that is still to be written. On a very fast stream, this would require a very large buffer since every request would be answered for once.
It was also submitted to SF patch tracker. Thadeu Cascardo
shell.patch3
Description: Binary data
