Changeset 278:50bfb29bf036 in freeDiameter
- Timestamp:
- Apr 23, 2010, 5:22:09 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/app_radgw
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/rgw_clients.c
r271 r278 260 260 rgw_msg_free(msg); 261 261 } else { 262 /* Update information for new message */ 263 if (cli->last[idx].ans) { 264 /* Free it */ 265 radius_msg_free(cli->last[idx].ans); 266 free(cli->last[idx].ans); 267 cli->last[idx].ans = NULL; 268 } 269 cli->last[idx].id = (*msg)->radius.hdr->identifier; 270 cli->last[idx].port = (*msg)->port; 262 /* We have not just received this message already */ 263 if (cli->last[idx].port == 0) { /* first message from this client */ 264 /* Just add the new information */ 265 ASSERT(cli->last[idx].ans == NULL); 266 cli->last[idx].id = (*msg)->radius.hdr->identifier; 267 cli->last[idx].port = (*msg)->port; 268 } else { 269 /* We have got previous message(s), update the info only if answered already */ 270 if (cli->last[idx].ans) { 271 cli->last[idx].id = (*msg)->radius.hdr->identifier; 272 cli->last[idx].port = (*msg)->port; 273 /* Free the previous answer */ 274 radius_msg_free(cli->last[idx].ans); 275 free(cli->last[idx].ans); 276 cli->last[idx].ans = NULL; 277 } 278 } 271 279 } 272 280 … … 607 615 } 608 616 cli->last[idx].ans = *msg; 617 cli->last[idx].id = req->radius.hdr->identifier; 618 cli->last[idx].port = req->port; 609 619 *msg = NULL; 610 620 -
extensions/app_radgw/rgw_msg.c
r258 r278 268 268 if (*session) { 269 269 CHECK_FCT( fd_sess_getsid(*session, &sess_str) ); 270 TRACE_DEBUG(FULL, "Session '%s' has been successfully %s.", sess_str, idx ? "created" : "retrieved"); 270 if (idx == 0) { 271 TRACE_DEBUG(INFO, "Another message was translated for this session ('%s') and not answered yet, discarding the new RADIUS request.", sess_str); 272 *session = NULL; 273 return EALREADY; 274 } 275 276 TRACE_DEBUG(FULL, "Translating new message for session '%s'...", sess_str); 271 277 272 278 /* Add the Session-Id AVP as first AVP */ -
extensions/app_radgw/rgw_worker.c
r271 r278 147 147 { 148 148 /* An error occurred, discard message */ 149 if (diam_msg) { 150 CHECK_FCT_DO( fd_msg_free(diam_msg), ); 151 diam_msg = NULL; 152 } 153 if (session) { 154 CHECK_FCT_DO( fd_sess_destroy(&session), ); 155 } 149 156 rgw_msg_free(&msg); 150 157 rgw_clients_dispose(&cli); … … 153 160 if (msg == NULL) { 154 161 rgw_clients_dispose(&cli); 162 if (diam_msg) { 163 CHECK_FCT_DO( fd_msg_free(diam_msg), ); 164 diam_msg = NULL; 165 } 166 if (session) { 167 CHECK_FCT_DO( fd_sess_destroy(&session), ); 168 } 155 169 continue; /* the message was handled already */ 156 170 } … … 176 190 } 177 191 178 /* Check the session is correct */192 /* Check the session is correct (for debug) */ 179 193 ASSERT(session != NULL); 180 194 … … 298 312 } 299 313 314 /* Clear the RADIUS request */ 315 if (pa->rad) { 316 rgw_msg_free(&pa->rad); 317 } 318 300 319 /* Release reference on the client */ 301 320 rgw_clients_dispose(&pa->cli);
Note: See TracChangeset
for help on using the changeset viewer.