Optimized const String usage in the SIP library.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4427 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
b0ec008617
commit
51111b0f6d
|
@ -462,8 +462,8 @@ void SIPEngine::buildAuth(const String& username, const String& realm, const Str
|
|||
String tmp;
|
||||
tmp << m1.hexDigest() << ":" << nonce << ":";
|
||||
if (qop) {
|
||||
if (qop == "auth")
|
||||
tmp << qop["nc"] << ":" << qop["cnonce"] << ":" << qop.c_str() << ":";
|
||||
if (qop == YSTRING("auth"))
|
||||
tmp << qop[YSTRING("nc")] << ":" << qop[YSTRING("cnonce")] << ":" << qop.c_str() << ":";
|
||||
else
|
||||
Debug(DebugStub,"SIPEngine::buildAuth() not implemented for qop=%s",
|
||||
qop.c_str());
|
||||
|
|
|
@ -297,7 +297,7 @@ void SIPMessage::complete(SIPEngine* engine, const char* user, const char* domai
|
|||
addHeader("Max-Forwards",tmp);
|
||||
}
|
||||
|
||||
if ((method == "INVITE") && !getHeader("Contact")) {
|
||||
if ((method == YSTRING("INVITE")) && !getHeader("Contact")) {
|
||||
// automatically add a contact field to (re)INVITE and its answers
|
||||
String tmp(user);
|
||||
if (!tmp) {
|
||||
|
@ -369,7 +369,7 @@ bool SIPMessage::parseFirst(String& line)
|
|||
version = line.matchString(3).toUpper();
|
||||
DDebug(DebugAll,"got request method='%s' uri='%s' version='%s'",
|
||||
method.c_str(),uri.c_str(),version.c_str());
|
||||
if (method == "ACK")
|
||||
if (method == YSTRING("ACK"))
|
||||
m_ack = true;
|
||||
}
|
||||
else {
|
||||
|
@ -638,7 +638,7 @@ MimeAuthLine* SIPMessage::buildAuth(const String& username, const String& passwo
|
|||
NamedList qop(TelEngine::c_safe(t->getParam("qop")));
|
||||
if (qop) {
|
||||
MimeHeaderLine::delQuotes(qop);
|
||||
if (qop == "auth") {
|
||||
if (qop == YSTRING("auth")) {
|
||||
String nc("00000001");
|
||||
if (engine)
|
||||
engine->ncGet(nc);
|
||||
|
@ -660,7 +660,7 @@ MimeAuthLine* SIPMessage::buildAuth(const String& username, const String& passwo
|
|||
auth->setParam("response",MimeHeaderLine::quote(response));
|
||||
auth->setParam("algorithm","MD5");
|
||||
// copy opaque data as-is, only if present
|
||||
const NamedString* opaque = t->getParam("opaque");
|
||||
const NamedString* opaque = t->getParam(YSTRING("opaque"));
|
||||
if (opaque)
|
||||
auth->setParam(opaque->name(),*opaque);
|
||||
if (qop) {
|
||||
|
|
|
@ -65,7 +65,7 @@ SIPTransaction::SIPTransaction(SIPMessage* message, SIPEngine* engine, bool outg
|
|||
}
|
||||
}
|
||||
}
|
||||
m_invite = (getMethod() == "INVITE");
|
||||
m_invite = (getMethod() == YSTRING("INVITE"));
|
||||
m_state = Initial;
|
||||
m_engine->append(this);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue