changeset 416:5c5d72fd7f2a

Added more verbose information on connection message
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 16 Jun 2009 13:55:52 +0900
parents 540ed390c04f
children 4d56917a5e42
files waaad/peer-psm.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/waaad/peer-psm.c	Tue Jun 16 13:37:46 2009 +0900
+++ b/waaad/peer-psm.c	Tue Jun 16 13:55:52 2009 +0900
@@ -165,11 +165,18 @@
 /* Attempt a new connection */
 static int _psm_connect( _peer_t * peer, _pevent_t event, void * ev_data )
 {
+	uint16_t port;
 	TRACE_ENTRY("%p(%s/%s) %d(%s) %p", peer, peer->p_diamid ?: "null", STATESTR(peer->p_state), event, EVENTSTR(event), ev_data);
 	
 	CHECK_PARAMS_DO( peer->p_diamid, return 2 );
 	
-	TRACE_DEBUG(INFO, "Connecting to peer '%s'...", peer->p_diamid);
+	if (peer->p_addinfo.pa_ss.ss_family == AF_INET) {
+		port = ntohs( ((sSA4 *)(&peer->p_addinfo.pa_ss))->sin_port );
+	} else {
+		port = ntohs( ((sSA6 *)(&peer->p_addinfo.pa_ss))->sin6_port );
+	}
+	
+	TRACE_DEBUG(INFO, "Connecting to peer '%s' on port '%s:%hd'...", peer->p_diamid, peer->p_addinfo.pa_proto == IPPROTO_SCTP ? "STCP" : "TCP", port);
 	
 	/* go to STATE_WAITCNXACK state */
 	_psm_change_state(peer, STATE_WAITCNXACK);
"Welcome to our mercurial repository"