Commit 5be551b2 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Checking for Max-Forwards header and its contents in nua/test_proxy.c.

darcs-hash:20060503135850-65a35-04b25b2e95462d7726a172a81cc2b8a040bb3094.gz
parent a8cdc87a
......@@ -372,6 +372,7 @@ int proxy_request(struct proxy *proxy,
url_t const *request_uri, *target;
struct proxy_transaction *t = NULL;
sip_request_t *rq = NULL;
sip_max_forwards_t *mf;
/* We don't do any route processing */
request_uri = sip->sip_request->rq_url;
......@@ -407,6 +408,16 @@ int proxy_request(struct proxy *proxy,
target = b->contact->m_url;
}
mf = sip->sip_max_forwards;
if (mf && mf->mf_count <= 1) {
if (sip->sip_request->rq_method == sip_method_options) {
return process_options(proxy, irq, sip);
}
nta_incoming_treply(irq, SIP_483_TOO_MANY_HOPS, TAG_END());
return 483;
}
t = proxy_transaction_new(proxy);
if (t == NULL) {
nta_incoming_treply(irq, SIP_500_INTERNAL_SERVER_ERROR, TAG_END());
......
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