[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Short sftp packet!


sftp_write needs only handle, buffer and size. it’s a write from start to finish.

RSz = Read 4 or 16K from SourceFile
while (RSz != EOF) {
                sftp_write(handle,ReadBuf,RSz);
                RSz = Read 4 or 16K from SourceFile
}

checked our implementation; we use a block size of 30K; works fine.

From: Rafael Hovhannisyan [mailto:psrafo@xxxxxxxxx]
Sent: Tuesday, August 23, 2016 10:13
To: libssh@xxxxxxxxxx
Subject: Re: Short sftp packet!

> Isn't there a 0.7 version available?
No, latest version is 0.6.1 for my dist.

> Try reading and writing in blocks of 4K.  Do this to EOF of source file.
I can't set the start offset of bytes for writing; there is no argument in function which I can find.

2016-08-23 17:44 GMT+04:00 Andreas Schneider <asn@xxxxxxxxxxxxxx<mailto:asn@xxxxxxxxxxxxxx>>:
On Tuesday, 23 August 2016 16:58:47 CEST Rafael Hovhannisyan wrote:
> LIBSFTP VERSION: 3
> LIBSSH VERSION: 0.6.1-0ubuntu3.3
>
> 2016-08-23 15:54 GMT+04:00 Rafael Hovhannisyan <psrafo@xxxxxxxxx<mailto:psrafo@xxxxxxxxx>>:
> > Hello everybody.
> >
> > I have a problem, which I can't understand by myself. When I am trying to
> > write long files(bigger than 255 kb) via sftp_write function, I am getting
> > an error message(Short sftp packet!); but when file was created/updated on
> > remote server, it was with zero bytes.
> >
> > Code: https://github.com/psrafo/justup/blob/master/src/justup.c#L330
Isn't there a 0.7 version available?

--
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org<http://www.cryptomilk.org>                asn@xxxxxxxxxxxxxx<mailto:asn@xxxxxxxxxxxxxx>


Follow-Ups:
Re: Short sftp packet!Rafael Hovhannisyan <psrafo@xxxxxxxxx>
References:
Short sftp packet!Rafael Hovhannisyan <psrafo@xxxxxxxxx>
Re: Short sftp packet!Rafael Hovhannisyan <psrafo@xxxxxxxxx>
Re: Short sftp packet!Andreas Schneider <asn@xxxxxxxxxxxxxx>
Re: Short sftp packet!Rafael Hovhannisyan <psrafo@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org