Mercurial > hg > freeDiameter
diff extensions/test_app/ta_cli.c @ 706:4ffbc9f1e922
Large UNTESTED commit with the following changes:
* Improved DiameterIdentity handling (esp. interationalization issues),
and improve efficiency of some string operations in peers, sessions,
and dictionary modules (closes #7)
* Cleanup in the session module to free only unreferenced sessions (#16)
* Removed fd_cpu_flush_cache(), replaced by more robust alternatives.
* Improved peer state machine algorithm to counter SCTP multistream race
condition.
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Wed, 09 Feb 2011 15:26:58 +0900 |
parents | 2e94ef0515d7 |
children | 4a9f08d6b6ba |
line wrap: on
line diff
--- a/extensions/test_app/ta_cli.c Mon Jan 31 17:22:21 2011 +0900 +++ b/extensions/test_app/ta_cli.c Wed Feb 09 15:26:58 2011 +0900 @@ -149,7 +149,8 @@ CHECK_FCT_DO( fd_msg_new( ta_cmd_r, MSGFL_ALLOC_ETEID, &req ), goto out ); /* Create a new session */ - CHECK_FCT_DO( fd_sess_new( &sess, fd_g_config->cnf_diamid, "app_test", 8 ), goto out ); + #define TEST_APP_SID_OPT "app_test" + CHECK_FCT_DO( fd_sess_new( &sess, fd_g_config->cnf_diamid, fd_g_config->cnf_diamid_len, (os0_t)TEST_APP_SID_OPT, CONSTSTRLEN(TEST_APP_SID_OPT) ), goto out ); /* Create the random value to store with the session */ mi = malloc(sizeof(struct ta_mess_info)); @@ -164,11 +165,12 @@ /* Session-Id */ { - char * sid; - CHECK_FCT_DO( fd_sess_getsid ( sess, &sid ), goto out ); + os0_t sid; + size_t sidlen; + CHECK_FCT_DO( fd_sess_getsid ( sess, &sid, &sidlen ), goto out ); CHECK_FCT_DO( fd_msg_avp_new ( ta_sess_id, 0, &avp ), goto out ); - val.os.data = (uint8_t *)sid; - val.os.len = strlen(sid); + val.os.data = sid; + val.os.len = sidlen; CHECK_FCT_DO( fd_msg_avp_setvalue( avp, &val ), goto out ); CHECK_FCT_DO( fd_msg_avp_add( req, MSG_BRW_FIRST_CHILD, avp ), goto out );