diff --git a/include/fc/exception.hpp b/include/fc/exception.hpp index 65f4752..19020cf 100644 --- a/include/fc/exception.hpp +++ b/include/fc/exception.hpp @@ -71,8 +71,8 @@ namespace fc { fc::string to_string( uint32_t v ); fc::string to_string( int16_t v ); fc::string to_string( uint16_t v ); - fc::string to_string( size_t v ); - fc::string to_string( long int v ); +// fc::string to_string( size_t v ); +// fc::string to_string( long int v ); template void throw_exception( const char* func, const char* file, int line, const char* msg, T&& a1 ) { diff --git a/include/fc/http/connection.hpp b/include/fc/http/connection.hpp index 109923d..0f33ed4 100644 --- a/include/fc/http/connection.hpp +++ b/include/fc/http/connection.hpp @@ -17,6 +17,7 @@ namespace fc { struct reply { enum status_code { OK = 200, + RecordCreated = 201, NotFound = 404, Found = 302, InternalServerError = 500 diff --git a/src/base58.cpp b/src/base58.cpp index 724625b..1fc5dc9 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -100,12 +100,12 @@ public: CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } + //CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(int64_t n) { BN_init(this); setint64(n); } CBigNum(unsigned char n) { BN_init(this); setulong(n); } CBigNum(unsigned short n) { BN_init(this); setulong(n); } CBigNum(unsigned int n) { BN_init(this); setulong(n); } - CBigNum(unsigned long n) { BN_init(this); setulong(n); } + //CBigNum(unsigned long n) { BN_init(this); setulong(n); } CBigNum(uint64_t n) { BN_init(this); setuint64(n); } explicit CBigNum(const std::vector& vch) diff --git a/src/context.hpp b/src/context.hpp index fdef8ba..fc4657c 100644 --- a/src/context.hpp +++ b/src/context.hpp @@ -32,10 +32,10 @@ namespace fc { complete(false), cur_task(0) { - my_context.fc_stack.base = alloc.allocate( bc::minimum_stacksize() ); - // slog( "new stack %1% bytes at %2%", bc::minimum_stacksize(), my_context.fc_stack.base ); + my_context.fc_stack.base = alloc.allocate( bc::default_stacksize() ); + // slog( "new stack %1% bytes at %2%", bc::default_stacksize(), my_context.fc_stack.base ); my_context.fc_stack.limit = - static_cast( my_context.fc_stack.base) - bc::minimum_stacksize(); + static_cast( my_context.fc_stack.base) - bc::default_stacksize(); make_fcontext( &my_context, sf ); } @@ -52,7 +52,7 @@ namespace fc { ~context() { if(stack_alloc) { - stack_alloc->deallocate( my_context.fc_stack.base, bc::minimum_stacksize() ); + stack_alloc->deallocate( my_context.fc_stack.base, bc::default_stacksize() ); // slog("deallocate stack" ); } } diff --git a/src/exception.cpp b/src/exception.cpp index 332f463..d69d34c 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include namespace fc { @@ -72,16 +72,16 @@ namespace fc { fc::string to_string( char v ) { return fc::string(&v,1); } - fc::string to_string( uint64_t v ) { return boost::lexical_cast(v).c_str(); } - fc::string to_string( int64_t v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( double v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( float v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( int32_t v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( uint32_t v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( int16_t v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( uint16_t v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( size_t v ){ return boost::lexical_cast(v).c_str(); } - fc::string to_string( long int v ){ return boost::lexical_cast(v).c_str(); } + fc::string to_string( uint64_t v ) { return fc::lexical_cast(v).c_str(); } + fc::string to_string( int64_t v ){ return fc::lexical_cast(v).c_str(); } + fc::string to_string( double v ){ return fc::lexical_cast(v).c_str(); } + fc::string to_string( float v ){ return fc::lexical_cast(v).c_str(); } + fc::string to_string( int32_t v ){ return fc::lexical_cast(v).c_str(); } + fc::string to_string( uint32_t v ){ return fc::lexical_cast(v).c_str(); } + fc::string to_string( int16_t v ){ return fc::lexical_cast(v).c_str(); } + fc::string to_string( uint16_t v ){ return fc::lexical_cast(v).c_str(); } +// fc::string to_string( size_t v ){ return fc::lexical_cast(v).c_str(); } + //fc::string to_string( long int v ){ return fc::lexical_cast(v).c_str(); } void throw_exception( const char* func, const char* file, int line, const char* msg ) { ::boost::exception_detail::throw_exception_(fc::generic_exception(msg),func, file, line ); diff --git a/src/http_connection.cpp b/src/http_connection.cpp index c072a87..f933625 100644 --- a/src/http_connection.cpp +++ b/src/http_connection.cpp @@ -1,6 +1,7 @@ #include #include #include +#include FC_START_SHARED_IMPL(fc::http::connection) @@ -68,16 +69,21 @@ void connection::connect_to( const fc::ip::endpoint& ep ) { http::reply connection::request( const fc::string& method, const fc::string& url, const fc::string& body ) { + + fc::stringstream req; req << method <<" "<sock.write( head.c_str(), head.size() ); - if( body.size() ) + if( body.size() ) { my->sock.write( body.c_str(), body.size() ); + } + fc::cerr.flush(); return my->parse_reply(); }