Commit bc25e159 authored by baire's avatar baire
Browse files

do not remove escape sequences in non-generic parameters of via

parent 7b1b8dee
Loading
Loading
Loading
Loading
+25 −4
Original line number Diff line number Diff line
@@ -668,10 +668,31 @@ void GenericParam::PostDecode (Buffer& buffer) throw (DecodeError)
		Charstring& value = Get_paramValue();

		if (value.GetLength() &&
		    (*value.GetValueBin() == '"'))
		    (*value.GetValueBin() == '"')) {
			normalise_quoted_string (value, true);
		else
		} else {
			const char* par_name = Get_id().GetValue();
			
			Variable* param_list = GetParent();
			if (param_list) {
			    Variable* parent = param_list->GetParent();
			    if (parent) {
				const char* ptype = parent->GetTypeName();
				//TODO: add other unescaped params
				if (strcmp (ptype, "ViaBody") == 0) {
					if ((strcmp (par_name, "branch") == 0)
					 || (strcmp (par_name, "ttl") == 0)
					 || (strcmp (par_name, "maddr") == 0)
					 || (strcmp (par_name, "received") == 0))
						goto skip_escape;
				}
			    }
			}
do_escape:
			normalise_escaped_string (value);
skip_escape: ;

		}
	}
}