Navigation


Changeset 1180:773498f59520 in freeDiameter for libfdcore/cnxctx.c


Ignore:
Timestamp:
Jun 5, 2013, 4:02:29 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Preparing for future DTLS/SCTP support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/cnxctx.c

    r1145 r1180  
    15341534#else /* DISABLE_SCTP */
    15351535                /* Initialize the wrapper, start the demux thread */
    1536                 CHECK_FCT( fd_sctps_init(conn) );
     1536                CHECK_FCT( fd_sctp3436_init(conn) );
    15371537#endif /* DISABLE_SCTP */
    15381538        } else {
     
    15941594#ifndef DISABLE_SCTP
    15951595                /* Start reading the messages from the master session. That way, if the remote peer closed, we are not stuck inside handshake */
    1596                 CHECK_FCT(fd_sctps_startthreads(conn, 0));
     1596                CHECK_FCT(fd_sctp3436_startthreads(conn, 0));
    15971597
    15981598                /* Resume all additional sessions from the master one. */
    1599                 CHECK_FCT(fd_sctps_handshake_others(conn, priority, alt_creds));
     1599                CHECK_FCT(fd_sctp3436_handshake_others(conn, priority, alt_creds));
    16001600
    16011601                /* Start decrypting the messages from all threads and queuing them in target queue */
    1602                 CHECK_FCT(fd_sctps_startthreads(conn, 1));
     1602                CHECK_FCT(fd_sctp3436_startthreads(conn, 1));
    16031603#endif /* DISABLE_SCTP */
    16041604        } else {
     
    17611761                                                ssize_t ret;
    17621762                                                size_t sent = 0;
    1763                                                 ASSERT(conn->cc_sctps_data.array != NULL);
     1763                                                ASSERT(conn->cc_sctp3436_data.array != NULL);
    17641764                                                do {
    1765                                                         CHECK_GNUTLS_DO( ret = fd_tls_send_handle_error(conn, conn->cc_sctps_data.array[conn->cc_sctp_para.next].session, buf + sent, len - sent), );
     1765                                                        CHECK_GNUTLS_DO( ret = fd_tls_send_handle_error(conn, conn->cc_sctp3436_data.array[conn->cc_sctp_para.next].session, buf + sent, len - sent), );
    17661766                                                        if (ret <= 0)
    17671767                                                                return ENOTCONN;
     
    18101810                        if (! fd_cnx_teststate(conn, CC_STATUS_ERROR ) ) {
    18111811                                /* and other stream pairs */
    1812                                 fd_sctps_bye(conn);
     1812                                fd_sctp3436_bye(conn);
    18131813                        }
    18141814
    18151815                        if (! fd_cnx_teststate(conn, CC_STATUS_ERROR ) ) {
    18161816                                /* Now wait for all decipher threads to terminate */
    1817                                 fd_sctps_waitthreadsterm(conn);
     1817                                fd_sctp3436_waitthreadsterm(conn);
    18181818                        } else {
    18191819                                /* Abord the threads, the connection is dead already */
    1820                                 fd_sctps_stopthreads(conn);
     1820                                fd_sctp3436_stopthreads(conn);
    18211821                        }
    18221822
    18231823                        /* Deinit gnutls resources */
    1824                         fd_sctps_gnutls_deinit_others(conn);
     1824                        fd_sctp3436_gnutls_deinit_others(conn);
    18251825                        if (conn->cc_tls_para.session) {
    18261826                                GNUTLS_TRACE( gnutls_deinit(conn->cc_tls_para.session) );
     
    18291829                       
    18301830                        /* Destroy the wrapper (also stops the demux thread) */
    1831                         fd_sctps_destroy(conn);
     1831                        fd_sctp3436_destroy(conn);
    18321832
    18331833                } else {
    18341834#endif /* DISABLE_SCTP */
    1835                 /* We are TLS, but not using the sctps wrapper layer */
     1835                /* We are TLS, but not using the sctp3436 wrapper layer */
    18361836                        if (! fd_cnx_teststate(conn, CC_STATUS_ERROR ) ) {
    18371837                                /* Master session */
Note: See TracChangeset for help on using the changeset viewer.