From owner-freebsd-questions@FreeBSD.ORG Sun Nov 30 16:37:19 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35ABF1065670 for ; Sun, 30 Nov 2008 16:37:19 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 04F9C8FC08 for ; Sun, 30 Nov 2008 16:37:18 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id 17336AFC1C6; Sun, 30 Nov 2008 07:37:18 -0900 (AKST) From: Mel To: freebsd-questions@freebsd.org Date: Sun, 30 Nov 2008 17:36:28 +0100 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200811301736.30079.fbsd.questions@rachie.is-a-geek.net> Cc: Eugene Pimenov Subject: Re: Pasting via ssh causes data loss X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2008 16:37:19 -0000 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 > > 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.