From 1e03393b6813b8dc77916665d8940475f06acdb2 Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Sat, 25 Mar 2006 12:57:37 +0000
Subject: [PATCH] Some cleanups/fixes for various TRACE statements

--HG--
extra : convert_revision : 84eb6fedc6df0666f8053b9018bf16635dbfb257
---
 cli-auth.c        | 2 +-
 cli-chansession.c | 4 ++--
 common-channel.c  | 2 +-
 svr-auth.c        | 7 ++++---
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/cli-auth.c b/cli-auth.c
index d08de9a3..ba4cf6c1 100644
--- a/cli-auth.c
+++ b/cli-auth.c
@@ -236,8 +236,8 @@ void recv_msg_userauth_success() {
 
 void cli_auth_try() {
 
-	TRACE(("enter cli_auth_try"))
 	int finished = 0;
+	TRACE(("enter cli_auth_try"))
 
 	CHECKCLEARTOWRITE();
 	
diff --git a/cli-chansession.c b/cli-chansession.c
index 6d358b7f..1dad6071 100644
--- a/cli-chansession.c
+++ b/cli-chansession.c
@@ -162,14 +162,14 @@ void cli_tty_cleanup() {
 
 static void put_termcodes() {
 
-	TRACE(("enter put_termcodes"))
-
 	struct termios tio;
 	unsigned int sshcode;
 	const struct TermCode *termcode;
 	unsigned int value;
 	unsigned int mapcode;
 
+	TRACE(("enter put_termcodes"))
+
 	unsigned int bufpos1, bufpos2;
 
 	if (tcgetattr(STDIN_FILENO, &tio) == -1) {
diff --git a/common-channel.c b/common-channel.c
index 68d2b488..0be354d8 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -236,7 +236,7 @@ static void checkclose(struct Channel *channel) {
 	TRACE(("checkclose: writefd %d, readfd %d, errfd %d, sentclosed %d, recvclosed %d",
 				channel->writefd, channel->readfd,
 				channel->errfd, channel->sentclosed, channel->recvclosed))
-	TRACE(("writebuf %d extrabuf %s extrabuf %d",
+	TRACE(("writebuf size %d extrabuf ptr 0x%x extrabuf size %d",
 				cbuf_getused(channel->writebuf),
 				channel->writebuf,
 				channel->writebuf ? 0 : cbuf_getused(channel->extrabuf)))
diff --git a/svr-auth.c b/svr-auth.c
index f0fca388..d0eba9bf 100644
--- a/svr-auth.c
+++ b/svr-auth.c
@@ -315,14 +315,15 @@ void send_msg_userauth_failure(int partial, int incrfail) {
 	buf_setpos(typebuf, 0);
 	buf_putstring(ses.writepayload, buf_getptr(typebuf, typebuf->len),
 			typebuf->len);
+
+	TRACE(("auth fail: methods %d, '%s'", ses.authstate.authtypes,
+				buf_getptr(typebuf, typebuf->len)));
+
 	buf_free(typebuf);
 
 	buf_putbyte(ses.writepayload, partial ? 1 : 0);
 	encrypt_packet();
 
-	TRACE(("auth fail: methods %d, '%s'", ses.authstate.authtypes,
-				buf_getptr(typebuf, typebuf->len)));
-
 	if (incrfail) {
 		usleep(300000); /* XXX improve this */
 		ses.authstate.failcount++;
-- 
GitLab