channel_write_wontblock should be triggered by channel_rcv_change_window
Currently channel_write_wontblock
is called when the socket is writable.
If the peer increases the window after the socket became writable, the callback is not called though the channel becomes writable.
From log:
(Socket is writable)
ssh_socket_pollcallback: Poll callback on socket 26 (POLLOUT ), out buffer 0
ssh_socket_pollcallback: sending control flow event
ssh_packet_socket_controlflow_callback: sending channel_write_wontblock callback
(Peer increases window from 0 to 65536)
ssh_socket_pollcallback: Poll callback on socket 26 (POLLIN ), out buffer 0
ssh_packet_socket_callback: packet: read type 93 [len=16,padding=6,comp=9,payload=9]
ssh_packet_process: Dispatching handler for packet type 93
channel_rcv_change_window: Adding 65536 bytes to channel (43:0) (from 0 bytes)
ssh_packet_socket_callback: Processing 36 bytes left in socket buffer