From: Robert J. <rjo...@us...> - 2007-06-29 07:20:33
|
Update of /cvsroot/openh323/opal/src/sip In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5329 Modified Files: sippdu.cxx Log Message: Small clean up of User-Agent string. Index: sippdu.cxx =================================================================== RCS file: /cvsroot/openh323/opal/src/sip/sippdu.cxx,v retrieving revision 2.132 retrieving revision 2.133 diff -C2 -d -r2.132 -r2.133 *** sippdu.cxx 29 Jun 2007 06:59:58 -0000 2.132 --- sippdu.cxx 29 Jun 2007 07:20:26 -0000 2.133 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 2.133 2007/06/29 07:20:26 rjongbloed + * Small clean up of User-Agent string. + * * Revision 2.132 2007/06/29 06:59:58 rjongbloed * Major improvement to the "product info", normalising H.221 and User-Agent mechanisms. *************** *** 1262,1265 **** --- 1265,1270 ---- + static const char UserAgentTokenChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.!%*_+`'~"; + void SIPMIMEInfo::GetProductInfo(OpalProductInfo & info) { *************** *** 1277,1282 **** // All other variations just end up as one big comment ! static const char TokenChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.!%*_+`'~"; ! PINDEX endFirstToken = str.FindSpan(TokenChars); if (endFirstToken == 0) { info.name = str; --- 1282,1286 ---- // All other variations just end up as one big comment ! PINDEX endFirstToken = str.FindSpan(UserAgentTokenChars); if (endFirstToken == 0) { info.name = str; *************** *** 1286,1290 **** } ! PINDEX endSecondToken = str[endFirstToken] == '/' ? str.FindSpan(TokenChars, endFirstToken+1) : endFirstToken; info.name = str.Left(endFirstToken); --- 1290,1294 ---- } ! PINDEX endSecondToken = str[endFirstToken] == '/' ? str.FindSpan(UserAgentTokenChars, endFirstToken+1) : endFirstToken; info.name = str.Left(endFirstToken); *************** *** 1298,1307 **** PString userAgent = ua; if (userAgent.IsEmpty()) { - - static const char TokenChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.!%*_+`'~"; - PINDEX pos; PCaselessString temp = info.name; ! while ((pos = temp.FindSpan(TokenChars)) != P_MAX_INDEX) temp.Delete(pos, 1); if (!temp.IsEmpty()) { --- 1302,1309 ---- PString userAgent = ua; if (userAgent.IsEmpty()) { PINDEX pos; PCaselessString temp = info.name; ! temp.Replace(' ', '-', TRUE); ! while ((pos = temp.FindSpan(UserAgentTokenChars)) != P_MAX_INDEX) temp.Delete(pos, 1); if (!temp.IsEmpty()) { *************** *** 1309,1322 **** temp = info.version; ! while ((pos = temp.FindSpan(TokenChars)) != P_MAX_INDEX) temp.Delete(pos, 1); if (!temp.IsEmpty()) userAgent += '/' + temp; - - temp = info.vendor; - temp.Replace("(", "\\(", TRUE); - temp.Replace(")", "\\)", TRUE); - if (!temp.IsEmpty()) - userAgent += " (" + temp + ')'; } } --- 1311,1319 ---- temp = info.version; ! temp.Replace(' ', '-', TRUE); ! while ((pos = temp.FindSpan(UserAgentTokenChars)) != P_MAX_INDEX) temp.Delete(pos, 1); if (!temp.IsEmpty()) userAgent += '/' + temp; } } |