Navigation


Changeset 1198:8c4dd4b693c6 in freeDiameter for libfdcore


Ignore:
Timestamp:
Jun 13, 2013, 6:30:14 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Some cleanups in the traces

Location:
libfdcore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/cnxctx.c

    r1192 r1198  
    293293        fd_sa_sdump_numeric(sa_buf, sa);
    294294       
     295        LOG_D("Connecting to TCP %s...", sa_buf);
     296       
    295297        /* Create the socket and connect, which can take some time and/or fail */
    296298        {
    297299                int ret = fd_tcp_client( &sock, sa, addrlen );
    298300                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));
    300302                        return NULL;
    301303                }
     
    348350        fd_sa_sdump_numeric(sa_buf, &((struct fd_endpoint *)(list->next))->sa);
    349351       
     352        LOG_D("Connecting to SCTP %s:%hu...", sa_buf, port);
     353       
    350354        {
    351355                int ret = fd_sctp_client( &sock, no_ip6, port, list );
    352356                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));
    354358                        return NULL;
    355359                }
  • libfdcore/p_cnx.c

    r1190 r1198  
    7878        uint16_t        port_no; /* network order */
    7979        int             dotls_immediate;
     80        int count = 0;
    8081       
    8182        TRACE_ENTRY("%p", peer);
     
    184185                                fd_list_insert_before(&peer->p_connparams, &new->chain);
    185186                        }
     187                        count++;
    186188                }
    187189        }
     
    206208                        fd_list_insert_after(&peer->p_connparams, &new->chain); /* very first position */
    207209                }
     210                count++;
    208211        }
    209212#endif /* DISABLE_SCTP */
     213       
     214        LOG_D("Prepared %d sets of connection parameters to peer %s", count, peer->p_hdr.info.pi_diamid);
    210215       
    211216        return 0;
  • libfdcore/p_psm.c

    r1186 r1198  
    814814                               
    815815                        case STATE_WAITCNXACK:
    816                                 LOG_D("%s: Connection attempt failed", peer->p_hdr.info.pi_diamid);
    817816                                /* Go back to CLOSE */
    818817                                fd_psm_next_timeout(peer, 1, peer->p_hdr.info.config.pic_tctimer ?: fd_g_config->cnf_timer_tc);
  • libfdcore/sctp.c

    r1197 r1198  
    936936       
    937937        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;
    948939                /* 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));
    950941                goto out;
    951942        }
  • libfdcore/tcp.c

    r1127 r1198  
    124124        int ret = 0;
    125125        int s;
    126         char * buf = NULL; size_t len = 0;
    127126       
    128127        TRACE_ENTRY("%p %p %d", sock, sa, salen);
     
    138137        pthread_cleanup_push(fd_cleanup_socket, &s);
    139138       
    140         LOG_D( "Attempting TCP connection to %s...", fd_sa_dump(&buf, &len, NULL, sa, NI_NUMERICHOST | NI_NUMERICSERV)?:"<error>" );
    141         free(buf);
    142        
    143139        /* Try connecting to the remote address */
    144140        ret = connect(s, sa, salen);
     
    147143       
    148144        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));
    161147                CHECK_SYS_DO( close(s), /* continue */ );
    162148                *sock = -1;
Note: See TracChangeset for help on using the changeset viewer.