From Bugzilla Helper: User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.5-0.2.9 i686) Description of problem: ttcp -r sends both the transmitted data, and the connection logging and transfer statistics to stdout. This adds junk to the end of file transfers, and prevents using ttcp for network integrity checking. How reproducible: Always Steps to Reproduce: 1. In window a$ ttcp -r > x.x 2. In window b$ dd if=/dev/zero bs=1 count=100 | ttcp -t localhost 3. in window a$ ls -l x.x ; cat -v x.x Actual Results: $ ttcp -r > x.x ttcp-r: socket ttcp-r: accept from 127.0.0.1 $ ls -l x.x ; cat -v x.x -rw-r--r-- 1 johnm cos 340 Jul 24 19:51 x.x ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp ttcp-r: 100 bytes in 0.00 real seconds = 22.83 KB/sec +++ ttcp-r: 2 I/O calls, msec/call = 2.19, calls/sec = 467.51 ttcp-r: 0.0user 0.0sys 0:00real 0% 0i+0d 0maxrss 0+1pf 0+0csw ======== e.g. first 2 printfs go to stderr, rest get appended to data file (now 340 bytes instead of 100). Expected Results: $ /usr/src/redhat/BUILD/ttcp-1.12/ttcp -r > x.x ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp ttcp-r: socket ttcp-r: accept from 127.0.0.1 ttcp-r: 100 bytes in 0.00 real seconds = 25.81 KB/sec +++ ttcp-r: 2 I/O calls, msec/call = 1.94, calls/sec = 528.54 ttcp-r: 0.0user 0.0sys 0:00real 0% 0i+0d 0maxrss 0+1pf 0+0csw $ ls -l x.x ; cat -v x.x -rw-r--r-- 1 johnm cos 100 Jul 24 19:52 x.x ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@$ ======== e.g. all the printfs go to stderr, transferred file is same size as sent. Additional info: It may also be a good idea to add a -q flag to supress all diagnositc output.
Created attachment 24687 [details] replace add stdout's with stderr
Nice one. Also fixed now in my src.rpm at http://www.netcore.fi/pekkas/linux/ipv6/. As for '-q'.. I think that'd be rather non-mainstream use, and better would be just to redirect stderr to /dev/null locally if needed.
this bug from july 2001 rawhide is still present in final RH72, and is still marked new in bugzilla.
I've pushed out new version of ttcp with several changes (mainly from Pekka's upstream)