Browse code

whitespaces printed in stats now

Jiri Kuthan authored on 27/08/2002 11:56:19
Showing 3 changed files
... ...
@@ -105,4 +105,11 @@
105 105
 
106 106
 /* maximum length of Contact heder field in redirection replies */
107 107
 #define MAX_REDIRECTION_LEN 512
108
+
109
+/* used by FIFO statistics in module to terminate line;
110
+   extra whitespaces are used to overwrite remainders of
111
+   previous line if longer than current one
112
+*/
113
+#define CLEANUP_EOL "      \n"
114
+
108 115
 #endif
... ...
@@ -25,7 +25,7 @@ int print_stats(  FILE *f )
25 25
 		cur_stats->transactions );
26 26
 	fprintf(f, "local: %d, ",
27 27
 		cur_stats->client_transactions );
28
-	fprintf(f, "waiting: %d\n",
28
+	fprintf(f, "waiting: %d" CLEANUP_EOL ,
29 29
 		cur_stats->waiting );
30 30
 
31 31
 	fprintf(f, "Total:\n");
... ...
@@ -33,10 +33,10 @@ int print_stats(  FILE *f )
33 33
 		acc_stats->transactions );
34 34
 	fprintf(f, " local: %d,",
35 35
 		acc_stats->client_transactions );
36
-	fprintf(f, " waiting: %d\n",
36
+	fprintf(f, " waiting: %d" CLEANUP_EOL ,
37 37
 		acc_stats->waiting );
38 38
 
39
-	fprintf(f, "Replied localy: %d\n",
39
+	fprintf(f, "Replied localy: %d" CLEANUP_EOL ,
40 40
 		acc_stats->replied_localy );
41 41
 	fprintf(f, "Completion status 6xx: %d,",
42 42
 		acc_stats->completed_6xx );
... ...
@@ -46,7 +46,7 @@ int print_stats(  FILE *f )
46 46
 		acc_stats->completed_4xx );
47 47
 	fprintf(f, " 3xx: %d,",
48 48
 		acc_stats->completed_3xx );
49
-	fprintf(f, "2xx: %d\n",
49
+	fprintf(f, "2xx: %d" CLEANUP_EOL ,
50 50
 		acc_stats->completed_2xx );
51 51
 	
52 52
 	return 1;
... ...
@@ -461,7 +461,7 @@ case $1 in
461 461
 			echo "error opening read fifo $path"
462 462
 			exit 1
463 463
 		fi
464
-		trap "rm $path; echo sc monitor ^C-ed; exit 1" 2
464
+		trap "rm $path; clear; echo sc monitor ^C-ed; exit 1" 2
465 465
 		attempt=0
466 466
 		clear
467 467
 		while [ 1 -eq 1 ]; do