Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 3,148 Lines • ▼ Show 20 Lines | std::string userAgent(const Config &config) { | ||||
uacomments.push_back("EB" + eb); | uacomments.push_back("EB" + eb); | ||||
// Comments are checked for char compliance at startup, it is safe to add | // Comments are checked for char compliance at startup, it is safe to add | ||||
// them to the user agent string | // them to the user agent string | ||||
for (const std::string &cmt : gArgs.GetArgs("-uacomment")) { | for (const std::string &cmt : gArgs.GetArgs("-uacomment")) { | ||||
uacomments.push_back(cmt); | uacomments.push_back(cmt); | ||||
} | } | ||||
// Size compliance is checked at startup, it is safe to not check it again | std::string uaclient; | ||||
std::string subversion = | if (gArgs.IsArgSet("-uaclient")) { | ||||
deadalnix: That check happens within `gArgs.GetArg` already. | |||||
FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, uacomments); | uaclient = gArgs.GetArg("-uaclient", ""); | ||||
} else { | |||||
uaclient = FormatUserAgent(CLIENT_NAME, CLIENT_VERSION); | |||||
} | |||||
return subversion; | // Size compliance is checked at startup, it is safe to not check it again | ||||
return FormatSubVersionUserAgent(uaclient, uacomments); | |||||
} | } |
That check happens within gArgs.GetArg already.