Added missing const qualifiers.

This commit is contained in:
Gunnar Beutner 2013-02-02 09:19:49 +01:00
parent 11cf07fa9c
commit 18f935cfa2
2 changed files with 6 additions and 6 deletions

View File

@ -170,7 +170,7 @@ void Utility::InitializeOpenSSL(void)
* @param cakey CA certificate chain file. * @param cakey CA certificate chain file.
* @returns An SSL context. * @returns An SSL context.
*/ */
shared_ptr<SSL_CTX> Utility::MakeSSLContext(String pubkey, String privkey, String cakey) shared_ptr<SSL_CTX> Utility::MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey)
{ {
InitializeOpenSSL(); InitializeOpenSSL();
@ -224,7 +224,7 @@ String Utility::GetCertificateCN(const shared_ptr<X509>& certificate)
* @param pemfile The filename. * @param pemfile The filename.
* @returns An X509 certificate. * @returns An X509 certificate.
*/ */
shared_ptr<X509> Utility::GetX509Certificate(String pemfile) shared_ptr<X509> Utility::GetX509Certificate(const String& pemfile)
{ {
X509 *cert; X509 *cert;
BIO *fpcert = BIO_new(BIO_s_file()); BIO *fpcert = BIO_new(BIO_s_file());
@ -254,7 +254,7 @@ shared_ptr<X509> Utility::GetX509Certificate(String pemfile)
* @param text The String that should be checked. * @param text The String that should be checked.
* @returns true if the wildcard pattern matches, false otherwise. * @returns true if the wildcard pattern matches, false otherwise.
*/ */
bool Utility::Match(String pattern, String text) bool Utility::Match(const String& pattern, const String& text)
{ {
return (match(pattern.CStr(), text.CStr()) == 0); return (match(pattern.CStr(), text.CStr()) == 0);
} }

View File

@ -37,11 +37,11 @@ public:
static void Daemonize(void); static void Daemonize(void);
static shared_ptr<SSL_CTX> MakeSSLContext(String pubkey, String privkey, String cakey); static shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey);
static String GetCertificateCN(const shared_ptr<X509>& certificate); static String GetCertificateCN(const shared_ptr<X509>& certificate);
static shared_ptr<X509> GetX509Certificate(String pemfile); static shared_ptr<X509> GetX509Certificate(const String& pemfile);
static bool Match(String pattern, String text); static bool Match(const String& pattern, const String& text);
static String DirName(const String& path); static String DirName(const String& path);
static String BaseName(const String& path); static String BaseName(const String& path);