Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
libssh2-hs can't send 3megabyte file #10
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
OK, found the bug. I'd submit a pull request but I'm not sure of the correctness of my fix. The problem is as follows:
I made transfers work (https://gist.github.com/5428276) but this doesn't feel all right since there are 3 possible states for session direction: [INBOUND], [OUTBOUND], [INBOUND, OUTBOUND] (as seen in int2dir).
During file transfers, the observed direction is the latest, and in this case it only needs to threadWaitWrite, but what if there were a case where it needed to threadWaitRead too? This "fix" would undoubtedly break.
In any case, take this patch as a proof of concept as to where the bug is.