Skip to content

Commit

Permalink
Remove problematic easylzma
Browse files Browse the repository at this point in the history
  • Loading branch information
vikramrajkumar committed Jun 23, 2015
1 parent 943fe51 commit 701b9ac
Show file tree
Hide file tree
Showing 51 changed files with 7 additions and 8,075 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Expand Up @@ -15,13 +15,13 @@
*.a
*.lib

#CMake->MSVC artifacts
# CMake->MSVC artifacts
*.sln
*.vcxproj
ALL_BUILD
ZERO_CHECK

#MSVC secondary artifacts
# MSVC secondary artifacts
*.suo
*.vcxproj.filters
*.vcxproj.user
Expand All @@ -48,7 +48,6 @@ fc_automoc.cpp
git_revision.cpp
GitSHA3.cpp

lzma_test
ntp_test
task_cancel_test
udt_client
Expand Down
10 changes: 2 additions & 8 deletions CMakeLists.txt
Expand Up @@ -225,7 +225,6 @@ set( fc_sources
src/network/gntp.cpp
src/compress/smaz.cpp
src/compress/zlib.cpp
src/compress/lzma.cpp
vendor/cyoencode-1.0.2/src/CyoDecode.c
vendor/cyoencode-1.0.2/src/CyoEncode.c
)
Expand All @@ -240,7 +239,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/git_revision.cpp.in" "${CMAKE_CU
list(APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp")
list(APPEND sources ${fc_headers})

add_subdirectory( vendor/easylzma )
add_subdirectory( vendor/websocketpp )
add_subdirectory( vendor/udt4 )

Expand Down Expand Up @@ -300,14 +298,13 @@ target_include_directories(fc
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include
${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/easylzma/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/udt4/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/websocketpp
${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp
)

#target_link_libraries( fc PUBLIC easylzma_static udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${ECC_LIB} )
target_link_libraries( fc PUBLIC -L/usr/local/lib easylzma_static udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} )
#target_link_libraries( fc PUBLIC udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${ECC_LIB} )
target_link_libraries( fc PUBLIC -L/usr/local/lib udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} )

if(MSVC)
set_source_files_properties( src/network/http/websocket.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
Expand Down Expand Up @@ -352,9 +349,6 @@ target_link_libraries( udt_server fc udt )
add_executable( udt_client tests/udtc.cpp )
target_link_libraries( udt_client fc udt )

add_executable( lzma_test tests/lzma_test.cpp )
target_link_libraries( lzma_test fc )

add_executable( ecc_test tests/ecc_test.cpp )
target_link_libraries( ecc_test fc )

Expand Down
19 changes: 0 additions & 19 deletions include/fc/compress/lzma.hpp

This file was deleted.

3 changes: 1 addition & 2 deletions include/fc/log/file_appender.hpp
Expand Up @@ -18,7 +18,6 @@ class file_appender : public appender {
bool rotate = false;
microseconds rotation_interval;
microseconds rotation_limit;
bool rotation_compression = false;
};
file_appender( const variant& args );
~file_appender();
Expand All @@ -32,4 +31,4 @@ class file_appender : public appender {

#include <fc/reflect/reflect.hpp>
FC_REFLECT( fc::file_appender::config,
(format)(filename)(flush)(rotate)(rotation_interval)(rotation_limit)(rotation_compression) )
(format)(filename)(flush)(rotate)(rotation_interval)(rotation_limit) )
201 changes: 0 additions & 201 deletions src/compress/lzma.cpp

This file was deleted.

38 changes: 2 additions & 36 deletions src/log/file_appender.cpp
@@ -1,4 +1,3 @@
#include <fc/compress/lzma.hpp>
#include <fc/exception/exception.hpp>
#include <fc/io/fstream.hpp>
#include <fc/log/file_appender.hpp>
Expand All @@ -13,8 +12,6 @@

namespace fc {

static const string compression_extension( ".lzma" );

class file_appender::impl : public fc::retainable
{
public:
Expand All @@ -25,7 +22,6 @@ namespace fc {
private:
future<void> _rotation_task;
time_point_sec _current_file_start_time;
std::unique_ptr<thread> _compression_thread;

time_point_sec get_file_start_time( const time_point_sec& timestamp, const microseconds& interval )
{
Expand All @@ -34,26 +30,6 @@ namespace fc {
return time_point_sec( (uint32_t)(file_number * interval_seconds) );
}

void compress_file( const fc::path& filename )
{
FC_ASSERT( cfg.rotate && cfg.rotation_compression );
FC_ASSERT( _compression_thread );
if( !_compression_thread->is_current() )
{
_compression_thread->async( [this, filename]() { compress_file( filename ); }, "compress_file" ).wait();
return;
}

try
{
lzma_compress_file( filename, filename.parent_path() / (filename.filename().string() + compression_extension) );
remove_all( filename );
}
catch( ... )
{
}
}

public:
impl( const config& c) : cfg( c )
{
Expand All @@ -62,9 +38,6 @@ namespace fc {
FC_ASSERT( cfg.rotation_interval >= seconds( 1 ) );
FC_ASSERT( cfg.rotation_limit >= cfg.rotation_interval );

if( cfg.rotation_compression )
_compression_thread.reset( new thread( "compression") );

_rotation_task = async( [this]() { rotate_files( true ); }, "rotate_files(1)" );
}
}
Expand Down Expand Up @@ -132,17 +105,11 @@ namespace fc {
remove_all( *itr );
continue;
}

if( !cfg.rotation_compression )
continue;
if( current_filename.find( compression_extension ) != string::npos )
continue;
compress_file( *itr );
}
}
catch (const fc::canceled_exception&)
{
throw;
throw;
}
catch( ... )
{
Expand All @@ -160,8 +127,7 @@ namespace fc {
format( "${timestamp} ${thread_name} ${context} ${file}:${line} ${method} ${level}] ${message}" ),
filename(p),
flush(true),
rotate(false),
rotation_compression(false)
rotate(false)
{}

file_appender::file_appender( const variant& args ) :
Expand Down

0 comments on commit 701b9ac

Please sign in to comment.