Changeset 1198:8c4dd4b693c6 in freeDiameter for libfdcore
- Timestamp:
- Jun 13, 2013, 6:30:14 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libfdcore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/cnxctx.c
r1192 r1198 293 293 fd_sa_sdump_numeric(sa_buf, sa); 294 294 295 LOG_D("Connecting to TCP %s...", sa_buf); 296 295 297 /* Create the socket and connect, which can take some time and/or fail */ 296 298 { 297 299 int ret = fd_tcp_client( &sock, sa, addrlen ); 298 300 if (ret != 0) { 299 LOG_ A("TCP connection to %s failed: %s", sa_buf, strerror(ret));301 LOG_D("TCP connection to %s failed: %s", sa_buf, strerror(ret)); 300 302 return NULL; 301 303 } … … 348 350 fd_sa_sdump_numeric(sa_buf, &((struct fd_endpoint *)(list->next))->sa); 349 351 352 LOG_D("Connecting to SCTP %s:%hu...", sa_buf, port); 353 350 354 { 351 355 int ret = fd_sctp_client( &sock, no_ip6, port, list ); 352 356 if (ret != 0) { 353 LOG_ A("SCTP connection to [%s,...] failed: %s", sa_buf, strerror(ret));357 LOG_D("SCTP connection to [%s,...] failed: %s", sa_buf, strerror(ret)); 354 358 return NULL; 355 359 } -
libfdcore/p_cnx.c
r1190 r1198 78 78 uint16_t port_no; /* network order */ 79 79 int dotls_immediate; 80 int count = 0; 80 81 81 82 TRACE_ENTRY("%p", peer); … … 184 185 fd_list_insert_before(&peer->p_connparams, &new->chain); 185 186 } 187 count++; 186 188 } 187 189 } … … 206 208 fd_list_insert_after(&peer->p_connparams, &new->chain); /* very first position */ 207 209 } 210 count++; 208 211 } 209 212 #endif /* DISABLE_SCTP */ 213 214 LOG_D("Prepared %d sets of connection parameters to peer %s", count, peer->p_hdr.info.pi_diamid); 210 215 211 216 return 0; -
libfdcore/p_psm.c
r1186 r1198 814 814 815 815 case STATE_WAITCNXACK: 816 LOG_D("%s: Connection attempt failed", peer->p_hdr.info.pi_diamid);817 816 /* Go back to CLOSE */ 818 817 fd_psm_next_timeout(peer, 1, peer->p_hdr.info.config.pic_tctimer ?: fd_g_config->cnf_timer_tc); -
libfdcore/sctp.c
r1197 r1198 936 936 937 937 if (ret < 0) { 938 int lvl; 939 switch (ret = errno) { 940 case ECONNREFUSED: 941 942 /* "Normal" errors */ 943 lvl = FULL; 944 break; 945 default: 946 lvl = INFO; 947 } 938 ret = errno; 948 939 /* Some errors are expected, we log at different level */ 949 TRACE_DEBUG( lvl,"sctp_connectx returned an error: %s", strerror(ret));940 LOG_A("sctp_connectx returned an error: %s", strerror(ret)); 950 941 goto out; 951 942 } -
libfdcore/tcp.c
r1127 r1198 124 124 int ret = 0; 125 125 int s; 126 char * buf = NULL; size_t len = 0;127 126 128 127 TRACE_ENTRY("%p %p %d", sock, sa, salen); … … 138 137 pthread_cleanup_push(fd_cleanup_socket, &s); 139 138 140 LOG_D( "Attempting TCP connection to %s...", fd_sa_dump(&buf, &len, NULL, sa, NI_NUMERICHOST | NI_NUMERICSERV)?:"<error>" );141 free(buf);142 143 139 /* Try connecting to the remote address */ 144 140 ret = connect(s, sa, salen); … … 147 143 148 144 if (ret < 0) { 149 int lvl; 150 switch (ret = errno) { 151 case ECONNREFUSED: 152 153 /* "Normal" errors */ 154 lvl = FULL; 155 break; 156 default: 157 lvl = INFO; 158 } 159 /* Some errors are expected, we log at different level */ 160 TRACE_DEBUG( lvl, "connect returned an error: %s", strerror(ret)); 145 ret = errno; 146 LOG_A( "connect returned an error: %s", strerror(ret)); 161 147 CHECK_SYS_DO( close(s), /* continue */ ); 162 148 *sock = -1;
Note: See TracChangeset
for help on using the changeset viewer.