Formerly PuTTY's SFTP code would transmit (or buffer) a megabyte of data
before even starting to look for acknowledgements, but wouldn't allow
there to be more than a megabyte of unacknowledged data at a time. Now,
instead, it pays attention to whether the transmit path is blocked, and
transmits iff it isn't.
This should mean that SFTP goes faster over long fat pipes, and also
doesn't end up buffering so much over thin ones.
I practice, I tend to run into other performance limitations (such as
TCP or SSH-2 windows) before this enhancement looks particularly good,
but with an artificial lag of 250 ms on the loopback interface this
patch almost doubles my upload speed, so I think it's worthwhile.
back->send(backhandle, buf, len);
return 1;
}
+int sftp_sendbuffer(void)
+{
+ return back->sendbuffer(backhandle);
+}
/* ----------------------------------------------------------------------
* sftp-based replacement for the hacky `pscp -ls'.
back->send(backhandle, buf, len);
return 1;
}
+int sftp_sendbuffer(void)
+{
+ return back->sendbuffer(backhandle);
+}
/*
* Short description of parameters.
int xfer_upload_ready(struct fxp_xfer *xfer)
{
- if (xfer->req_totalsize < xfer->req_maxsize)
+ if (sftp_sendbuffer() == 0)
return 1;
else
return 0;
* until len is available, or it returns failure.
*
* Both functions return 1 on success, 0 on failure.
+ *
+ * sftp_sendbuffer returns the size of the backlog of data in the
+ * transmit queue.
*/
int sftp_senddata(char *data, int len);
+int sftp_sendbuffer(void);
int sftp_recvdata(char *data, int len);
/*