Navigation


Changeset 996:cf09fde3d7f5 in freeDiameter for extensions/app_radgw/rgw_worker.c


Ignore:
Timestamp:
Mar 20, 2013, 12:13:14 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Children:
997:632913581c37, 998:ad6c1ee04d2d
Phase:
public
Message:

Fix management of sessions in app_radgw: sessions are simply associated with messages, that is sufficient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgw_worker.c

    r979 r996  
    5454        struct rgw_radius_msg_meta * rad;  /* the RADIUS message that was received and translated */
    5555        struct rgw_client          * cli;  /* the client it was received from */
    56         struct session             * sess; /* the Diameter session created for this message (useful?) */
    5756};
    5857
     
    7675                struct rgw_radius_msg_meta * msg;
    7776                struct rgw_client * cli;
    78                 struct session * session;
    7977                struct msg * diam_msg;
    8078                int pb, a;
     
    133131                        }  );
    134132               
    135                 session = NULL;
    136                
    137133                /* Pass the message to the list of registered plugins */
    138                 CHECK_FCT_DO( rgw_plg_loop_req(&msg, &session, &diam_msg, cli),
     134                CHECK_FCT_DO( rgw_plg_loop_req(&msg, &diam_msg, cli),
    139135                        {
    140136                                /* An error occurred, discard message */
     
    142138                                        CHECK_FCT_DO( fd_msg_free(diam_msg), );
    143139                                        diam_msg = NULL;
    144                                 }
    145                                 if (session) {
    146                                         CHECK_FCT_DO( fd_sess_destroy(&session), );
    147140                                }
    148141                                rgw_msg_free(&msg);
     
    181174                if (pb) {
    182175                        /* Something went wrong during the conversion */
    183                         if (session) {
    184                                 CHECK_FCT_DO( fd_sess_destroy(&session), );
    185                         }
    186                        
    187176                        if (diam_msg) {
    188177                                CHECK_FCT_DO( fd_msg_free(diam_msg), );
     
    202191                pa->rad = msg;
    203192                pa->cli = cli;
    204                 pa->sess= session;
    205193               
    206194                CHECK_FCT_DO( fd_msg_send( &diam_msg, receive_diam_answer, pa),
     
    208196                                /* If an error occurs, log and destroy the data */
    209197                                fd_log_debug("An error occurred while sending Diameter message, please turn Debug on for detail.");
    210                                 if (session) {
    211                                         CHECK_FCT_DO( fd_sess_destroy(&session), );
    212                                 }
    213198
    214199                                if (diam_msg) {
     
    239224        struct avp_hdr  *ahdr;
    240225        int pb = 0;
    241         int keepsession=0;
    242226       
    243227        TRACE_ENTRY("%p %p", pa, ans);
     
    248232       
    249233        /* Pass the Diameter answer to the same extensions as the request */
    250         CHECK_FCT_DO( rgw_plg_loop_ans(pa->rad, pa->sess, ans, &rad_ans, pa->cli, &keepsession), goto out );
     234        CHECK_FCT_DO( rgw_plg_loop_ans(pa->rad, ans, &rad_ans, pa->cli), goto out );
    251235
    252236        if (*ans != NULL) {
     
    300284        }
    301285       
    302         if (!keepsession) {
    303                 /* Destroy remaining session data (stateless gateway) */
    304                 CHECK_FCT_DO( fd_sess_destroy(&pa->sess),  );
    305         }
    306        
    307286        /* Clear the RADIUS request */
    308287        if (pa->rad) {
Note: See TracChangeset for help on using the changeset viewer.