Commit c0ed4050 authored by jan.koester's avatar jan.koester
Browse files

fixed image loading

parent 56185348
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -513,7 +513,7 @@ namespace blogi {
                    try{
                        std::string value;
                        _store->load(suuid,value);
                        curres.send(curcon, value.c_str(), value.size());
                        curres.send(curcon, value.c_str(), value.length());
                    }catch(...){
                        curres.setState(HTTP404);
                        curres.send(curcon,nullptr,0);
+7 −4
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *******************************************************************************/

#include <iostream>

#include <httppp/exception.h>

#include "backend.h"
@@ -60,12 +62,13 @@ REDISSAVE:
}

void blogi::RedisStore::load(const std::string key,std::string &value) {
    std::cout << "test" <<  std::endl;
REDISLOAD:
    redisReply* reply = (redisReply*) redisCommand(_RedisCTX, "GET %s",key.c_str());
    if(reply->str){
        value.clear();
    std::cout << reply->len << std::endl;
    if(reply->len>0){
        value.resize(reply->len);
        value.append(reply->str,reply->len);
        value.insert(0,reply->str,reply->len);
    }else{
        if(reconnect())
            goto REDISLOAD;
+1 −1

File changed.

Contains only whitespace changes.