Bug 49811 - ttcp -r stats output appended to data output
Summary: ttcp -r stats output appended to data output
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: ttcp
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokál
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-24 09:53 UTC by jm493
Modified: 2007-04-18 16:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-02-22 13:42:30 UTC
Embargoed:


Attachments (Terms of Use)
replace add stdout's with stderr (1.96 KB, patch)
2001-07-24 09:54 UTC, jm493
no flags Details | Diff

Description jm493 2001-07-24 09:53:20 UTC
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.

Comment 1 jm493 2001-07-24 09:54:54 UTC
Created attachment 24687 [details]
replace add stdout's with stderr

Comment 2 Pekka Savola 2001-07-24 10:22:17 UTC
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.

Comment 3 Jim Wright 2001-12-10 23:13:48 UTC
this bug from july 2001 rawhide is still present in final RH72, and is still
marked new in bugzilla.

Comment 4 Radek Vokál 2005-02-22 13:42:30 UTC
I've pushed out new version of ttcp with several changes (mainly from Pekka's
upstream)


Note You need to log in before you can comment on or make changes to this bug.