src/transport.c
changeset 62 ad5e484720e1
parent 48 9ff5d2dfa75a
child 63 f5b2641f4ae7
     1.1 --- a/src/transport.c	Tue Feb 10 08:27:36 2015 -0500
     1.2 +++ b/src/transport.c	Sat Feb 21 16:55:43 2015 +0100
     1.3 @@ -4,24 +4,26 @@
     1.4  #include <memory.h>
     1.5  #include <assert.h>
     1.6  
     1.7 -PEP_STATUS init_transport_system(PEP_SESSION session)
     1.8 +PEP_STATUS init_transport_system(PEP_SESSION session, bool in_first)
     1.9  {
    1.10 +    static PEP_transport_t transports[PEP_trans__count];
    1.11 +    
    1.12      assert(session);
    1.13 +    session->transports = transports;
    1.14  
    1.15 -    pEpSession *_session = (pEpSession *) session;
    1.16 -    PEP_transport_t* transports = _session->transports;
    1.17 +    if (in_first) {
    1.18 +        assert(PEP_trans__count == 1);
    1.19 +        memset(transports, 0, sizeof(PEP_transport_t) * PEP_trans__count);
    1.20  
    1.21 -    assert(PEP_trans__count == 1);
    1.22 -    memset(transports, 0, sizeof(PEP_transport_t) * PEP_trans__count);
    1.23 -
    1.24 -    transports[PEP_trans_auto].id = PEP_trans_auto;
    1.25 -    transports[PEP_trans_auto].sendto = auto_sendto;
    1.26 -    transports[PEP_trans_auto].readnext = auto_readnext;
    1.27 +        transports[PEP_trans_auto].id = PEP_trans_auto;
    1.28 +        transports[PEP_trans_auto].sendto = auto_sendto;
    1.29 +        transports[PEP_trans_auto].readnext = auto_readnext;
    1.30 +    }
    1.31  
    1.32      return PEP_STATUS_OK;
    1.33  }
    1.34  
    1.35 -void release_transport_system(PEP_SESSION session)
    1.36 +void release_transport_system(PEP_SESSION session, bool out_last)
    1.37  {
    1.38      assert(session);
    1.39      // nothing yet