Navigation


Changeset 1198:8c4dd4b693c6 in freeDiameter for libfdcore/tcp.c


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.