Commit 26280bc2 authored by Pekka Pessi's avatar Pekka Pessi

Fixed nua_set_hparams()/nua_get_hparams().

darcs-hash:20051008194023-65a35-702de4d700920afe68f67600bd30995ac5eb982b.gz
parent a694c962
......@@ -1091,10 +1091,7 @@ int ua_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
/* We have made changes to handle-specific settings
* but we don't have a prefs structure owned by handle yet */
nua_handle_preferences_t *ahp = su_alloc(nh->nh_home, sizeof *ahp);
if (ahp == NULL || su_home_move(nh->nh_home, tmphome) < 0) {
n = -1;
}
else {
if (ahp && su_home_move(nh->nh_home, tmphome) >= 0) {
memcpy(ahp, nhp, sizeof *ahp);
/* Zap pointers which are not set */
#define NHP_ZAP_UNSET_PTR(nhp, pref) \
......@@ -1105,6 +1102,11 @@ int ua_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
NHP_ZAP_UNSET_PTR(ahp, user_agent);
NHP_ZAP_UNSET_PTR(ahp, ua_name);
NHP_ZAP_UNSET_PTR(ahp, organization);
nh->nh_prefs = ahp;
}
else {
n = -1;
}
}
else if (su_home_move(nh->nh_home, tmphome) >= 0) {
......
......@@ -487,7 +487,6 @@ int test_params(struct context *ctx)
}
nua_destroy_event(ctx->a.saved_event);
if (0)
{
sip_from_t const *from = NONE;
char const *from_str = "NONE";
......@@ -579,13 +578,14 @@ int test_params(struct context *ctx)
NUTAG_REGISTRAR_REF(registrar),
TAG_END());
TEST(n, 1);
TEST(n, 3);
TEST(invite_timeout, 90);
TEST(from, NONE);
TEST_S(from_str, "NONE");
TEST_1(from != NULL && from != NONE);
TEST_1(strcmp(from_str, "NONE"));
/* Nothing else should be set */
TEST(retry_count, -1);
TEST(max_subscriptions, -1);
......@@ -594,7 +594,6 @@ int test_params(struct context *ctx)
TEST(early_media, -1);
TEST(auto_answer, -1);
TEST(auto_ack, -1);
TEST(invite_timeout, -1);
TEST(session_timer, -1);
TEST(min_se, -1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment