Loading plugins/media/media.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,15 @@ namespace blogi { throw exp; } redisReply *reply = (redisReply*)redisCommand(_RedisCTX, "AUTH %s", Args->config->getRedisPassword()); if (reply->type == REDIS_REPLY_ERROR) { libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Warning] << "media plugin err: " << _RedisCTX->errstr; throw exp; } freeReplyObject(reply); } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ Loading src/conf.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,12 @@ const char * blogi::Config::getRedisHost(){ return nullptr; } const char * blogi::Config::getRedisPassword(){ if(_PlsConfig->getKey("/BLOGI/REDIS/PASSWORD")) return _PlsConfig->getValue(_PlsConfig->getKey("/BLOGI/REDIS/PASSWORD"),0); return nullptr; } int blogi::Config::getRedisPort(){ if(_PlsConfig->getKey("/BLOGI/REDIS/PORT")) return _PlsConfig->getIntValue(_PlsConfig->getKey("/BLOGI/REDIS/PORT"),0); Loading src/conf.h +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ namespace blogi { const char *getRedisHost(); int getRedisPort(); const char *getRedisPassword(); private: Config(); Loading Loading
plugins/media/media.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,15 @@ namespace blogi { throw exp; } redisReply *reply = (redisReply*)redisCommand(_RedisCTX, "AUTH %s", Args->config->getRedisPassword()); if (reply->type == REDIS_REPLY_ERROR) { libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Warning] << "media plugin err: " << _RedisCTX->errstr; throw exp; } freeReplyObject(reply); } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ Loading
src/conf.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,12 @@ const char * blogi::Config::getRedisHost(){ return nullptr; } const char * blogi::Config::getRedisPassword(){ if(_PlsConfig->getKey("/BLOGI/REDIS/PASSWORD")) return _PlsConfig->getValue(_PlsConfig->getKey("/BLOGI/REDIS/PASSWORD"),0); return nullptr; } int blogi::Config::getRedisPort(){ if(_PlsConfig->getKey("/BLOGI/REDIS/PORT")) return _PlsConfig->getIntValue(_PlsConfig->getKey("/BLOGI/REDIS/PORT"),0); Loading
src/conf.h +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ namespace blogi { const char *getRedisHost(); int getRedisPort(); const char *getRedisPassword(); private: Config(); Loading