Navigation


Changeset 1078:74bba7975864 in freeDiameter for libfdcore/p_psm.c


Ignore:
Timestamp:
Apr 30, 2013, 4:37:57 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Cleanup the timing data and fd_msg_log feature that will be replaced by the new hooks mechanism. Kept the calls to fd_msg_log in comments to find the locations easily. WORK IN PROGRESS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_psm.c

    r1033 r1078  
    241241                        case FDEVP_CNX_INCOMING: {
    242242                                struct cnx_incoming * evd = ev->data;
    243                                 fd_msg_log( FD_MSG_LOG_DROPPED, evd->cer, "Message discarded while cleaning peer state machine queue." );
     243                                //fd_msg_log( FD_MSG_LOG_DROPPED, evd->cer, "Message discarded while cleaning peer state machine queue." );
    244244                                CHECK_FCT_DO( fd_msg_free(evd->cer), /* continue */);
    245245                                fd_cnx_destroy(evd->cnx);
     
    489489                struct msg * msg = NULL;
    490490                struct msg_hdr * hdr;
    491                 struct timespec rcvon;
    492                
    493                 /* Retrieve the piggytailed timestamp */
    494                 memcpy(&rcvon, ev_data+ev_sz, sizeof(struct timespec));
    495491               
    496492                /* Parse the received buffer */
     
    503499                        } );
    504500                       
    505                 CHECK_FCT_DO( fd_msg_ts_set_recv(msg, &rcvon), /* ... */ );
    506                
    507501                /* If the current state does not allow receiving messages, just drop it */
    508502                if (cur_state == STATE_CLOSED) {
    509503                        /* In such case, just discard the message */
    510                         fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Purged from peer '%s''s queue (CLOSED state).", peer->p_hdr.info.pi_diamid );
     504                        //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Purged from peer '%s''s queue (CLOSED state).", peer->p_hdr.info.pi_diamid );
    511505                        fd_msg_free(msg);
    512506                        goto psm_loop;
     
    514508               
    515509                /* Log incoming message */
    516                 fd_msg_log( FD_MSG_LOG_RECEIVED, msg, "Received %zdb from '%s' (%s)", ev_sz, peer->p_hdr.info.pi_diamid, STATE_STR(cur_state) );
     510                //fd_msg_log( FD_MSG_LOG_RECEIVED, msg, "Received %zdb from '%s' (%s)", ev_sz, peer->p_hdr.info.pi_diamid, STATE_STR(cur_state) );
    517511       
    518512                /* Extract the header */
     
    525519                        CHECK_FCT_DO( fd_p_sr_fetch(&peer->p_sr, hdr->msg_hbhid, &req), goto psm_end );
    526520                        if (req == NULL) {
    527                                 fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Answer received with no corresponding sent request." );
     521                                //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Answer received with no corresponding sent request." );
    528522                                fd_msg_free(msg);
    529523                                goto psm_loop;
     
    535529                        /* Display the delay to receive the answer */
    536530                        {
    537                                 struct timespec reqsent, delay;
    538                                 (void) fd_msg_ts_get_sent(req, &reqsent);
    539                                 TS_DIFFERENCE( &delay, &reqsent, &rcvon );
    540                                 fd_msg_log( FD_MSG_LOG_TIMING, msg, "Answer received in %ld.%6.6ld sec.", (long)delay.tv_sec, delay.tv_nsec / 1000 );
     531                                //fd_msg_log( FD_MSG_LOG_TIMING, msg, "Answer received in %ld.%6.6ld sec.", (long)delay.tv_sec, delay.tv_nsec / 1000 );
    541532                        }
    542533                } else {
     
    586577                                default:
    587578                                        /* In such case, just discard the message */
    588                                         fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Received from peer '%s' while connection was not in state %s.", peer->p_hdr.info.pi_diamid, STATE_STR(cur_state) );
     579                                        //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Received from peer '%s' while connection was not in state %s.", peer->p_hdr.info.pi_diamid, STATE_STR(cur_state) );
    589580                                        fd_msg_free(msg);
    590581                        }
     
    603594                                        if (msg) {
    604595                                                /* Only if an error occurred & the message was not saved / dumped */
    605                                                 fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) );
     596                                                //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) );
    606597                                                CHECK_FCT_DO( fd_msg_free(msg), goto psm_end);
    607598                                        }
     
    652643                                /* Cleanup the message if not done */
    653644                                if (msg) {
    654                                         fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Received un-handled non-routable command from peer '%s'.", peer->p_hdr.info.pi_diamid );
     645                                        //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Received un-handled non-routable command from peer '%s'.", peer->p_hdr.info.pi_diamid );
    655646                                        CHECK_FCT_DO( fd_msg_free(msg), /* continue */);
    656647                                        msg = NULL;
     
    660651                /* At this point the message must have been fully handled already */
    661652                if (msg) {
    662                         fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error ('%s'): unhandled message.", peer->p_hdr.info.pi_diamid );
     653                        //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error ('%s'): unhandled message.", peer->p_hdr.info.pi_diamid );
    663654                        fd_msg_free(msg);
    664655                }
     
    746737                }
    747738                if (params->cer) {
    748                         fd_msg_log( FD_MSG_LOG_DROPPED, params->cer, "Internal error: this CER was not handled as expected." );
     739                        //fd_msg_log( FD_MSG_LOG_DROPPED, params->cer, "Internal error: this CER was not handled as expected." );
    749740                        CHECK_FCT_DO( fd_msg_free(params->cer), );
    750741                        params->cer = NULL;
Note: See TracChangeset for help on using the changeset viewer.