Commit cc5d3e74 authored by Pekka Pessi's avatar Pekka Pessi

nta.c: be more tolerant to trivial syntax errors

nta used to respond with 400 Bad Xyzzy Header even if the most harmless
headers was malformed.

Problem reported by Mike Jerris.

darcs-hash:20061214223851-65a35-f612d478e493206881ec7c90554bd48e760dcef2.gz
parent 693d46ee
......@@ -369,6 +369,8 @@ nta_agent_t *nta_agent_create(su_root_t *root,
agent->sa_flags = MSG_DO_CANONIC;
agent->sa_maxsize = 2 * 1024 * 1024; /* 2 MB */
agent->sa_bad_req_mask = ~(sip_mask_response | sip_mask_proxy);
agent->sa_bad_resp_mask = ~(sip_mask_request | sip_mask_proxy);
agent->sa_t1 = NTA_SIP_T1;
agent->sa_t2 = NTA_SIP_T2;
agent->sa_t4 = NTA_SIP_T4;
......@@ -2053,7 +2055,7 @@ void agent_recv_request(nta_agent_t *agent,
insane = 0;
if (agent->sa_bad_req_mask)
if (agent->sa_bad_req_mask != ~0)
errors = msg_extract_errors(msg) & agent->sa_bad_req_mask;
else
errors = sip->sip_error != NULL;
......
......@@ -136,9 +136,9 @@ struct nta_agent_s
/** Request error mask */
unsigned short sa_bad_req_mask;
unsigned sa_bad_req_mask;
/** Response error mask */
unsigned short sa_bad_resp_mask;
unsigned sa_bad_resp_mask;
/** Maximum size of incoming messages */
size_t sa_maxsize;
......
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