Commit 55a6ed4d authored by urbant's avatar urbant
Browse files

function for whitespace removal

parent a697925d
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -61,6 +61,17 @@ private:
	const char*	mStart;
};

void remove_whitespace (Buffer & buffer) {
	static Regex reg_ws ("[ \t\r\n\f\v]+", REG_ICASE);
	if (reg_ws.Match (buffer)) {
		int nPos = buffer.GetPosition() + reg_ws.GetMatchedLength();
		buffer.SetPosition (nPos);
	}
}

//whitespace


#define SIPCHARS_MARK		"\\-_.!~*'()"
#define SIPCHARS_ALFA		"A-Za-z"
#define SIPCHARS_ALFANUM	"0-9" SIPCHARS_ALFA
@@ -97,7 +108,7 @@ private:
void SipUrl::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{

	static Regex reg_scheme ("^sip:", REG_ICASE);
	static Regex reg_scheme ("^sip[s]?:", REG_ICASE);
	static Regex reg_userinfo ("^([:" SIPCHARS_UNRESERVED SIPCHARS_USER_UNRESERVED "]|" SIPCHARS_ESCAPED "])+@", REG_ICASE);
	static Regex reg_hostport ("^[][" SIPCHARS_ALFANUM ":.\\-]+", REG_ICASE);
	static Regex reg_urlParams ("^;" SIPCHARS_PPARAM_ALLOWED, REG_ICASE);