Navigation


Changeset 706:4ffbc9f1e922 in freeDiameter for libfdcore/sctps.c


Ignore:
Timestamp:
Feb 9, 2011, 3:26:58 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Large UNTESTED commit with the following changes:

  • Improved DiameterIdentity? handling (esp. interationalization issues), and improve efficiency of some string operations in peers, sessions, and dictionary modules (closes #7)
  • Cleanup in the session module to free only unreferenced sessions (#16)
  • Removed fd_cpu_flush_cache(), replaced by more robust alternatives.
  • Improved peer state machine algorithm to counter SCTP multistream race condition.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/sctps.c

    r662 r706  
    5757*/
    5858
    59 
     59/* TODO: change this whole wrapper to DTLS which should not require many different threads */
    6060
    6161/*************************************************************/
     
    8383       
    8484        ASSERT( conn->cc_proto == IPPROTO_SCTP );
    85         ASSERT( Target_Queue(conn) );
     85        ASSERT( fd_cnx_target_queue(conn) );
    8686        ASSERT( conn->cc_sctps_data.array );
    8787       
    8888        do {
    89                 fd_cpu_flush_cache();
    90                 CHECK_FCT_DO( fd_sctp_recvmeta(conn->cc_socket, &strid, &buf, &bufsz, &event, &conn->cc_status), goto fatal );
     89                CHECK_FCT_DO( fd_sctp_recvmeta(conn, &strid, &buf, &bufsz, &event), goto fatal );
    9190                switch (event) {
    9291                        case FDEVP_CNX_MSG_RECV:
     
    102101                        case FDEVP_CNX_EP_CHANGE:
    103102                                /* Send this event to the target queue */
    104                                 fd_cpu_flush_cache();
    105                                 CHECK_FCT_DO( fd_event_send( Target_Queue(conn), event, bufsz, buf), goto fatal );
     103                                CHECK_FCT_DO( fd_event_send( fd_cnx_target_queue(conn), event, bufsz, buf), goto fatal );
    106104                                break;
    107105                       
     
    144142        CHECK_PARAMS_DO(ctx && ctx->raw_recv && ctx->parent, goto error);
    145143        cnx = ctx->parent;
    146         ASSERT( Target_Queue(cnx) );
     144        ASSERT( fd_cnx_target_queue(cnx) );
    147145       
    148146        /* Set the thread name */
     
    173171        CHECK_PARAMS_DO( tr && data, { errno = EINVAL; return -1; } );
    174172       
    175         fd_cpu_flush_cache();
    176         CHECK_FCT_DO( fd_sctp_sendstr(ctx->parent->cc_socket, ctx->strid, (uint8_t *)data, len, &ctx->parent->cc_status), /* errno is already set */ return -1 );
     173        CHECK_FCT_DO( fd_sctp_sendstr(ctx->parent, ctx->strid, (uint8_t *)data, len), /* errno is already set */ return -1 );
    177174       
    178175        return len;
     
    306303                struct sr_data * sr = (struct sr_data *)ret;
    307304               
    308                 if ( key.size < sr->key.size )
    309                         break;
    310                
    311                 if ( key.size > sr->key.size )
    312                         continue;
    313                
    314                 /* Key sizes are equal */
    315                 cmp = memcmp( key.data, sr->key.data, key.size );
    316                
     305                cmp = fd_os_cmp(key.data, key.size, sr->key.data, sr->key.size);
    317306                if (cmp > 0)
    318307                        continue;
     
    627616        /* End all TLS sessions, in series (not as efficient as paralel, but simpler) */
    628617        for (i = 1; i < conn->cc_sctp_para.pairs; i++) {
    629                 fd_cpu_flush_cache();
    630                 if ( ! (conn->cc_status & CC_STATUS_ERROR)) {
     618                if ( ! fd_cnx_teststate(conn, CC_STATUS_ERROR)) {
    631619                        CHECK_GNUTLS_DO( gnutls_bye(conn->cc_sctps_data.array[i].session, GNUTLS_SHUT_WR), fd_cnx_markerror(conn) );
    632620                }
Note: See TracChangeset for help on using the changeset viewer.