Navigation



Ignore:
Timestamp:
Apr 23, 2010, 5:22:09 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Try better handling several pending requests for the same session (not very clean yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgw_clients.c

    r271 r278  
    260260                rgw_msg_free(msg);
    261261        } 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                }
    271279        }
    272280       
     
    607615        }
    608616        cli->last[idx].ans = *msg;
     617        cli->last[idx].id = req->radius.hdr->identifier;
     618        cli->last[idx].port = req->port;
    609619        *msg = NULL;
    610620       
Note: See TracChangeset for help on using the changeset viewer.