Changeset 706:4ffbc9f1e922 in freeDiameter for libfdcore/p_cnx.c
- Timestamp:
- Feb 9, 2011, 3:26:58 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/p_cnx.c
r691 r706 36 36 #include "fdcore-internal.h" 37 37 38 39 /* TODO: change the behavior to handle properly forced ordering at beginning & end of OPEN state */ 40 38 41 /* This file contains code used by a peer state machine to initiate a connection to remote peer */ 39 42 … … 87 90 ret = getaddrinfo(peer->p_hdr.info.pi_diamid, NULL, &hints, &ai); 88 91 if (ret) { 89 fd_log_debug("Unable to resolve address for peer '%s' (%s), aborting\n", peer->p_hdr.info.pi_diamid, gai_strerror(ret));92 TRACE_DEBUG(INFO, "Unable to resolve address for peer '%s' (%s), aborting\n", peer->p_hdr.info.pi_diamid, gai_strerror(ret)); 90 93 if (ret != EAI_AGAIN) 91 94 fd_psm_terminate( peer, NULL ); … … 123 126 /* Now check we have at least one address to attempt */ 124 127 if (FD_IS_LIST_EMPTY(&peer->p_hdr.info.pi_endpoints)) { 125 fd_log_debug("No address %savailable to connect to peer '%s', aborting\n", peer->p_hdr.info.config.pic_flags.pro3 ? "in the configured family " : "", peer->p_hdr.info.pi_diamid); 128 TRACE_DEBUG(INFO, "No address %savailable to connect to peer '%s', aborting\n", 129 peer->p_hdr.info.config.pic_flags.pro3 ? "in the configured family " : "", peer->p_hdr.info.pi_diamid); 126 130 fd_psm_terminate( peer, NULL ); 127 131 return 0; … … 219 223 { 220 224 char buf[48]; 221 s printf(buf, "ConnTo:%.*s", (int)(sizeof(buf)) - 8, peer->p_hdr.info.pi_diamid);225 snprintf(buf, sizeof(buf), "ConnTo:%s", peer->p_hdr.info.pi_diamid); 222 226 fd_log_threadname ( buf ); 223 227 } … … 247 251 #ifndef DISABLE_SCTP 248 252 case IPPROTO_SCTP: 249 cnx = fd_cnx_cli_connect_sctp((peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_IP) ?: fd_g_config->cnf_flags.no_ip6, nc->port, &peer->p_hdr.info.pi_endpoints); 253 cnx = fd_cnx_cli_connect_sctp((peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_IP) ?: fd_g_config->cnf_flags.no_ip6, 254 nc->port, &peer->p_hdr.info.pi_endpoints); 250 255 break; 251 256 #endif /* DISABLE_SCTP */ … … 260 265 pthread_testcancel(); 261 266 262 } while (!cnx); /* and until cancellation */267 } while (!cnx); /* and until cancellation or all addresses attempted without success */ 263 268 264 269 /* Now, we have an established connection in cnx */ … … 274 279 { 275 280 /* Handshake failed ... */ 276 fd_log_debug("TLS Handshake failed with peer '%s', resetting the connection\n", peer->p_hdr.info.pi_diamid);281 TRACE_DEBUG(INFO, "TLS Handshake failed with peer '%s', resetting the connection\n", peer->p_hdr.info.pi_diamid); 277 282 fd_cnx_destroy(cnx); 278 283 empty_connection_list(peer);
Note: See TracChangeset
for help on using the changeset viewer.