Date: Sun, 30 Nov 2008 17:36:28 +0100 From: Mel <fbsd.questions@rachie.is-a-geek.net> To: freebsd-questions@freebsd.org Cc: Eugene Pimenov <libc.mail@gmail.com> Subject: Re: Pasting via ssh causes data loss Message-ID: <200811301736.30079.fbsd.questions@rachie.is-a-geek.net> In-Reply-To: <BE908921-8606-4D31-85A7-23C443EDA2B5@gmail.com> References: <BE908921-8606-4D31-85A7-23C443EDA2B5@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 30 November 2008 06:46:59 Eugene Pimenov wrote: > Hello everyone, > > I'm not really sure weither it's related to freebsd or ssh. > > When I paste a lot of data (6060 bytes, 60 lines 100 bytes each + > =91\n=92) via ssh into `cat > test.txt` or the small program, one freebsd > receives 5181, another receives 3221 bytes. > > The number of bytes freebsd receives are always the same. > > I can't reproduce this on linux (OpenSSH 4.3p2 on debian and OpenSSH > 4.7p1 on 2 gentoo boxes). Also, I have one freebsd box without this > problem (7.0-STABLE, openssh 4.5p1). > > Source of the small program: > > #include <stdio.h> > > int main() > { > char buf[10000]; > size_t readed =3D 0; > while(!feof(stdin)) { > readed+=3Dfread(buf, 1, sizeof(buf), stdin); > } > > printf("I've received %d bytes\n", readed); > return 0; > } > > Versions of sshd are =93OpenSSH_4.5p1 FreeBSD-20061110, OpenSSL 0.9.8e > 23 Feb 2007=94. FreeBSD versions are FreeBSD 7.0-BETA4 and FreeBSD 7.0- > RELEASE. > > Why is it happening? What should I do to stop this? It's pretty > annoying. Not sure, but can you copy files via cat? As in: cat /tmp/foo | ssh machine "cat - >/tmp/foo" If that isn't truncated, I can only think of clipboard limitations or tty=20 issues. =2D-=20 Mel Problem with today's modular software: they start with the modules and never get to the software part.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811301736.30079.fbsd.questions>