Revision 361409e7

View differences:

src/raft/FedReplicaManager.cc
107 107

  
108 108
    std::ostringstream oss;
109 109

  
110
    char * sql_db = logdb->escape_str(sql.c_str());
110
    std::string * zsql = one_util::zlib_compress(sql, true);
111

  
112
    if ( zsql == 0 )
113
    {
114
        pthread_mutex_unlock(&mutex);
115
        return -1;
116
    }
117

  
118
    char * sql_db = logdb->escape_str(zsql->c_str());
119

  
120
    delete zsql;
111 121

  
112 122
    if ( sql_db == 0 )
113 123
    {
......
392 402

  
393 403
int FedReplicaManager::get_log_record(int index, std::string& sql)
394 404
{
405
    std::string zsql;
406

  
395 407
    ostringstream oss;
396 408

  
397 409
    single_cb<std::string> cb;
398 410

  
399 411
    oss << "SELECT sqlcmd FROM fed_logdb WHERE log_index = " << index;
400 412

  
401
    cb.set_callback(&sql);
413
    cb.set_callback(&zsql);
402 414

  
403 415
    int rc = logdb->exec_rd(oss, &cb);
404 416

  
405 417
    cb.unset_callback();
406 418

  
419
    std::string * _sql = one_util::zlib_decompress(zsql, true);
420

  
421
    if ( _sql == 0 )
422
    {
423
        return -1;
424
    }
425

  
426
    sql = *_sql;
427

  
428
    delete _sql;
429

  
407 430
    return rc;
408 431
}
409 432

  
......
413 436
{
414 437
    std::ostringstream oss;
415 438

  
416
    char * sql_db = logdb->escape_str(sql.c_str());
439
    std::string * zsql = one_util::zlib_compress(sql, true);
440

  
441
    if ( zsql == 0 )
442
    {
443
        return -1;
444
    }
445

  
446
    char * sql_db = logdb->escape_str(zsql->c_str());
447

  
448
    delete zsql;
417 449

  
418 450
    if ( sql_db == 0 )
419 451
    {

Also available in: Unified diff