Commit 59c012d5 authored by baire's avatar baire
Browse files

removed the initial '^' in SIPREG_TOKEN (so as to be useable in the middle of a regex)

parent e4eac8c2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ void read_sp (Buffer & buffer, Variable* v) {
#define SIPCHARS_UTF8_NONASCII	"\xC0-\xFD"
#define SIPCHARS_UTF8_CONTENT	"\x80-\xBF"
#define SIPREG_ESCAPED	"(%[0-9A-Fa-f]{2})"
#define SIPREG_TOKEN "^[" SIPCHARS_ALFANUM ".!%*_+`'~\\-]+"
#define SIPREG_TOKEN "[" SIPCHARS_ALFANUM ".!%*_+`'~\\-]+"

//FIXME: WSP is not clearly defined (all whitespaces) 
#define SIPCHARS_WSP		" 	"
@@ -370,7 +370,7 @@ void GenericParam::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)

void RequestLine::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{
	static Regex reg_method (SIPREG_TOKEN);
	static Regex reg_method ("^" SIPREG_TOKEN);
	static Regex reg_request_uri ("[^ \t\n\r]+");
	static Regex reg_sip_version (SIPREG_SIP_VERSION);
	switch (id) {
@@ -447,7 +447,7 @@ void Method::Encode (Buffer& buffer) throw (EncodeError)

void Method::Decode (Buffer& buffer) throw (DecodeError)
{
	static Regex reg_method (SIPREG_TOKEN);
	static Regex reg_method ("^" SIPREG_TOKEN);

	reg_method.AssertMatch (buffer, this);