Loading plugins/media/media.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -530,8 +530,6 @@ namespace blogi { suuid.push_back('\0'); std::cout << "test:" << suuid << std::endl; blogi::SQL sql; blogi::DBResult res; Loading plugins/media/redis.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -53,10 +53,11 @@ blogi::RedisStore::RedisStore(const char *host,int port,const char *password){ } void blogi::RedisStore::save(const std::string key, const std::vector<char> value){ int tries=0; REDISSAVE: redisReply* reply = (redisReply*) redisCommand(_RedisCTX,"SET %s %b",key.c_str(),value.data(),value.size()); if (reply && reply->type==REDIS_REPLY_ERROR) { if(reconnect()) if(reconnect() && ++tries < 5) goto REDISSAVE; } freeReplyObject(reply); Loading @@ -68,12 +69,13 @@ REDISSAVE: } void blogi::RedisStore::load(const std::string key,std::vector<char> &value) { int tries=0; REDISLOAD: redisReply* reply = (redisReply*) redisCommand(_RedisCTX, "GET %s",key.c_str()); if(reply && reply->type!=REDIS_REPLY_ERROR){ std::copy(reply->str,reply->str+reply->len,std::inserter<std::vector<char>>(value,value.begin())); }else{ if(reconnect()) if(reconnect() && ++tries < 5) goto REDISLOAD; freeReplyObject(reply); libhttppp::HTTPException exp; Loading Loading
plugins/media/media.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -530,8 +530,6 @@ namespace blogi { suuid.push_back('\0'); std::cout << "test:" << suuid << std::endl; blogi::SQL sql; blogi::DBResult res; Loading
plugins/media/redis.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -53,10 +53,11 @@ blogi::RedisStore::RedisStore(const char *host,int port,const char *password){ } void blogi::RedisStore::save(const std::string key, const std::vector<char> value){ int tries=0; REDISSAVE: redisReply* reply = (redisReply*) redisCommand(_RedisCTX,"SET %s %b",key.c_str(),value.data(),value.size()); if (reply && reply->type==REDIS_REPLY_ERROR) { if(reconnect()) if(reconnect() && ++tries < 5) goto REDISSAVE; } freeReplyObject(reply); Loading @@ -68,12 +69,13 @@ REDISSAVE: } void blogi::RedisStore::load(const std::string key,std::vector<char> &value) { int tries=0; REDISLOAD: redisReply* reply = (redisReply*) redisCommand(_RedisCTX, "GET %s",key.c_str()); if(reply && reply->type!=REDIS_REPLY_ERROR){ std::copy(reply->str,reply->str+reply->len,std::inserter<std::vector<char>>(value,value.begin())); }else{ if(reconnect()) if(reconnect() && ++tries < 5) goto REDISLOAD; freeReplyObject(reply); libhttppp::HTTPException exp; Loading