The problem went away for my use case after [7c8519003d].

I think the key was in transport_load_buffer(..., 1000), that was waiting for either 1000 bytes or EOF. As with ssh EOF does not come, and data transmitted may be below 1000 bytes, we need a different approach.

With the ssh case, the call goes transport_load_buffer(..., 2), asking for two bytes or EOF.

I'm not sure if it works in all cases.