Skip to content

Commit

Permalink
set ver to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdead4ead committed Sep 10, 2018
1 parent e1547fc commit 5f4a23c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.11)

project(beast_http_server)
project(beast_http_server VERSION 100)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED on)
Expand Down
27 changes: 12 additions & 15 deletions include/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <functional>
#include <memory>

#define BEAST_HTTP_SERVER_VERSION 100

namespace http {

Expand Down Expand Up @@ -164,13 +165,6 @@ class listener : public std::enable_shared_from_this<listener> ,

using ptr = std::shared_ptr<listener>;

// listener(boost::asio::io_service& io_service, const std::string & address, const std::string & port)
// : acceptor_{io_service},
// socket_{io_service}
// {
// init(io_service, address, port);
// }

template <class F>
listener(boost::asio::io_service& io_service, const std::string & address, const std::string & port, F&& callback)
: acceptor_{io_service},
Expand Down Expand Up @@ -504,22 +498,25 @@ void read_up_to_enter(std::string & value){
}

void out(const std::string & info){
std::ostringstream os;
os << info << std::endl;
const std::string & info_ = os.str();
processor::get().write_to_stream(info_, boost::asio::transfer_exactly(info_.size()));
}
boost::posix_time::ptime timeLocal = boost::posix_time::second_clock::local_time();

void fail(const std::string & info){
std::ostringstream os;
os << info << std::endl;
os << '(' << "beast_http_server/" << BEAST_HTTP_SERVER_VERSION << " [" << BOOST_BEAST_VERSION_STRING << ']' << ' '
<< timeLocal.date().year() << '/' << timeLocal.date().day() << '/' << timeLocal.date().month() << ' '
<< timeLocal.time_of_day().hours() << ':' << timeLocal.time_of_day().minutes() << ':' << timeLocal.time_of_day().seconds() << ')' << ' '
<< info << std::endl;
const std::string & info_ = os.str();
processor::get().write_to_stream(info_, boost::asio::transfer_exactly(info_.size()));
}

void fail(const boost::system::error_code & ec, const std::string & info){
boost::posix_time::ptime timeLocal = boost::posix_time::second_clock::local_time();

std::ostringstream os;
os << info << " : " << ec.message() << std::endl;
os << '(' << "beast_http_server/" << BEAST_HTTP_SERVER_VERSION << " [" << BOOST_BEAST_VERSION_STRING << ']' << ' '
<< timeLocal.date().year() << '/' << timeLocal.date().day() << '/' << timeLocal.date().month() << ' '
<< timeLocal.time_of_day().hours() << ':' << timeLocal.time_of_day().minutes() << ':' << timeLocal.time_of_day().seconds() << ')' << ' '
<< info << " : " << ec.message() << std::endl;
const std::string & info_ = os.str();
processor::get().write_to_stream(info_, boost::asio::transfer_exactly(info_.size()));
}
Expand Down

0 comments on commit 5f4a23c

Please sign in to comment.