Commit eeec8d84 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

nta.c: streamlined NTATAG_REL100() handling in nta_outgoing_*create()

darcs-hash:20070523182900-65a35-be013b255ea54ff468a740c5ba562c22e69813eb.gz
parent 8a87d8e9
......@@ -6754,6 +6754,8 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
char const *scheme = NULL;
char const *port = NULL;
int invalid, resolved, stateless = 0, user_via = agent->sa_user_via;
int invite_100rel = agent->sa_invite_100rel;
tagi_t const *t;
tport_t const *override_tport = NULL;
......@@ -6818,6 +6820,9 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
else if (ntatag_tport == tt) {
override_tport = (tport_t *)t->t_value;
}
else if (ntatag_rel100 == tt) {
invite_100rel = t->t_value != 0;
}
}
orq->orq_agent = agent;
......@@ -6839,6 +6844,8 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
orq->orq_delay = UINT_MAX;
orq->orq_stateless = stateless != 0;
orq->orq_user_via = user_via != 0 && sip->sip_via;
orq->orq_100rel = invite_100rel;
if (cc)
orq->orq_cc = nta_compartment_ref(cc);
......@@ -7373,17 +7380,18 @@ int outgoing_features(nta_agent_t *agent, nta_outgoing_t *orq,
supported[i = 0] = NULL;
if (orq->orq_method == sip_method_invite) {
int add_100rel = agent->sa_invite_100rel;
int require_100rel = sip_has_feature(sip->sip_require, "100rel");
tl_gets(tags,
NTATAG_REL100_REF(add_100rel),
TAG_END());
if (add_100rel && !require_100rel &&
!sip_has_feature(sip->sip_supported, "100rel"))
supported[i++] = "100rel";
orq->orq_must_100rel = require_100rel;
if (require_100rel) {
orq->orq_must_100rel = 1;
orq->orq_100rel = 1;
}
else if (sip_has_feature(sip->sip_supported, "100rel")) {
orq->orq_100rel = 1;
}
else if (orq->orq_100rel) {
supported[i++] = "100rel";
}
}
if (i) {
......
......@@ -517,6 +517,7 @@ struct nta_outgoing_s
unsigned orq_sigcomp_zap:1; /**< Reset SigComp after completing */
unsigned orq_must_100rel : 1;
unsigned orq_timestamp : 1; /**< Insert @Timestamp header. */
unsigned orq_100rel:1; /**< Support 100rel */
unsigned : 0; /* pad */
#if HAVE_SOFIA_SRESOLV
......
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