X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/46cfeac8e5e6263f64f03028b98e27c0b09575f9..533c7491240f2fd71d026e91f0a940f4729992fd:/sftp.c diff --git a/sftp.c b/sftp.c index 4d9810fc..58b8e3e9 100644 --- a/sftp.c +++ b/sftp.c @@ -13,18 +13,6 @@ #include "tree234.h" #include "sftp.h" -#define GET_32BIT(cp) \ - (((unsigned long)(unsigned char)(cp)[0] << 24) | \ - ((unsigned long)(unsigned char)(cp)[1] << 16) | \ - ((unsigned long)(unsigned char)(cp)[2] << 8) | \ - ((unsigned long)(unsigned char)(cp)[3])) - -#define PUT_32BIT(cp, value) { \ - (cp)[0] = (unsigned char)((value) >> 24); \ - (cp)[1] = (unsigned char)((value) >> 16); \ - (cp)[2] = (unsigned char)((value) >> 8); \ - (cp)[3] = (unsigned char)(value); } - struct sftp_packet { char *data; unsigned length, maxlen; @@ -349,7 +337,7 @@ static struct sftp_request *sftp_alloc_request(void) void sftp_cleanup_request(void) { - if (sftp_requests == NULL) { + if (sftp_requests != NULL) { freetree234(sftp_requests); sftp_requests = NULL; } @@ -1141,7 +1129,7 @@ static struct fxp_xfer *xfer_init(struct fxp_handle *fh, uint64 offset) xfer->offset = offset; xfer->head = xfer->tail = NULL; xfer->req_totalsize = 0; - xfer->req_maxsize = 16384; + xfer->req_maxsize = 1048576; xfer->err = 0; xfer->filesize = uint64_make(ULONG_MAX, ULONG_MAX); xfer->furthestdata = uint64_make(0, 0); @@ -1181,7 +1169,7 @@ void xfer_download_queue(struct fxp_xfer *xfer) xfer->tail = rr; rr->next = NULL; - rr->len = 4096; + rr->len = 32768; rr->buffer = snewn(rr->len, char); sftp_register(req = fxp_read_send(xfer->fh, rr->offset, rr->len)); fxp_set_userdata(req, rr);