There is no way the consumer knows that another write is outstanding..
This is safe as it will "never" block, as soon as there is space, select
will return, and the correct write should be called to finish itself up,
unblocking the other...
I can picture a deadlock though where the write flag gets cleared when
finished up, and the other channel write was previously _EAGAIN'd...
This implies that a similar solution to read needs to be done, which is
if any write happens, spin the loop again, trying all the outstanding
writes to make sure they get a chance..
This fixes a bug where ggatessh was consuming 100% cpu because the
error from sftp_open wasn't being checked, now ggatessh will exit
if this fails (and log the failure)...
Add a test to make sure that a second session is launched and
works.. This discovered that the sftp_open wasn't passing in the
correct file name...
Now that there will be multiple IOs in flight, this should improve
performance a bit...
This I believe fixes problems with it. First off, is to call an
internal function to make sure to process any packets that are
pending despite there being no outstanding actions...
The second part is dealing w/ the issue that one channel may read
data for a previously processes channel... There isn't a good way
to get what channels have pending data, instead, use a custom wrapper
around recv, and if ANY data was read/returned, process all the pending
requests again. This will do a bit of extra work, but it a lot more
simple than fixing libssh2 to be sane...
720998f3 kex.c: fix simple typo, niumber -> number (#545)
cfe0bf64 session.c: Correct a typo which may lead to stack overflow (#533)
REVERT: f75f3488 add some debugging for understanding how these flags are set..
REVERT: 57635ddf disable read ahead algorithm so we don't waste bandwidth..
git-subtree-dir: libssh2
git-subtree-split: 720998f322f4bffffe531d5ec6a240c8c18459b2
not executed, so the old method won't work. This isn't great if there are
two scripts if/when it gets installed to base, but prefering the package
one seems to make sense over the built in one if it exists..
f75f3488 add some debugging for understanding how these flags are set..
57635ddf disable read ahead algorithm so we don't waste bandwidth..
git-subtree-dir: libssh2
git-subtree-split: f75f3488824d7935d15d75a869783b37fe446927
the performance is ok, but likely can be improved upon:
libcurl seems to not reuse connections, why not?
libcurl when using any auth, ALWAYS tries unauth'd for EVERY
request instead of caching that this url NEEDs auth
there are some error handling cases that could be improved