Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
Showing with 36 additions and 36 deletions.
  1. +6 −6 bench/db.cpp
  2. +9 −9 src/main.cpp
  3. +10 −10 src/net/handler.cpp
  4. +2 −2 src/queue/iqstream.cpp
  5. +3 −3 src/queue/oqstream.cpp
  6. +3 −3 src/queue/queue.cpp
  7. +3 −3 src/util/log.cpp
View
12 bench/db.cpp
@@ -83,7 +83,7 @@ class session : public enable_shared_from_this<session>
cerr << "[ERROR] " << method << ": " << message << endl;
}
- void fail(const string& method, const system::error_code& e)
+ void fail(const string& method, const boost::system::error_code& e)
{
cerr << "[ERROR] " << method << ": " << e.message() << endl;
}
@@ -116,7 +116,7 @@ class session : public enable_shared_from_this<session>
socket_, buffer(results_.get_request, buf_len), bind(&session::get_on_write, shared_from_this(), _1, _2));
}
- void get_on_write(const system::error_code& e, size_t bytes_transferred)
+ void get_on_write(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
return fail("get_on_write", e);
@@ -129,7 +129,7 @@ class session : public enable_shared_from_this<session>
async_read_until(socket_, in_, '\n', bind(&session::get_on_header, shared_from_this(), _1, _2));
}
- void get_on_header(const system::error_code& e, size_t bytes_transferred)
+ void get_on_header(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
return fail("get_on_header", e);
@@ -164,7 +164,7 @@ class session : public enable_shared_from_this<session>
}
}
- void get_on_value(const system::error_code& e, size_t bytes_transferred)
+ void get_on_value(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
return fail("get_on_value", e);
@@ -188,7 +188,7 @@ class session : public enable_shared_from_this<session>
socket_, buffer(results_.set_request, buf_len), bind(&session::set_on_write, shared_from_this(), _1, _2));
}
- void set_on_write(const system::error_code& e, size_t bytes_transferred)
+ void set_on_write(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
return fail("set_on_write", e);
@@ -207,7 +207,7 @@ class session : public enable_shared_from_this<session>
bind(&session::set_on_response, shared_from_this(), _1, _2));
}
- void set_on_response(const system::error_code& e, size_t bytes_transferred)
+ void set_on_response(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
return fail("set_on_response", e);
View
18 src/main.cpp
@@ -97,14 +97,14 @@ int main(int argc, char * argv[])
return 1;
}
- log::init(vm.count("debug"));
+ darner::log::init(vm.count("debug"));
- log::INFO("darner: queue server");
- log::INFO("build: %1% (%2%) v%3% (c) Wavii, Inc.", __DATE__, __TIME__, DARNER_VERSION);
- log::INFO("listening on port: %1%", port);
- log::INFO("data dir: %1%", data_path);
+ darner::log::INFO("darner: queue server");
+ darner::log::INFO("build: %1% (%2%) v%3% (c) Wavii, Inc.", __DATE__, __TIME__, DARNER_VERSION);
+ darner::log::INFO("listening on port: %1%", port);
+ darner::log::INFO("data dir: %1%", data_path);
if (vm.count("debug"))
- log::INFO("debug logging is turned ON");
+ darner::log::INFO("debug logging is turned ON");
// TODO: we're doing some manual pthread/signal stuff here
// migrate to signal_set when we are ready to use boost 1.47
@@ -114,7 +114,7 @@ int main(int argc, char * argv[])
sigset_t old_mask;
pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask);
- log::INFO("starting up");
+ darner::log::INFO("starting up");
server srv(data_path, port);
@@ -132,11 +132,11 @@ int main(int argc, char * argv[])
sigwait(&wait_mask, &sig);
// Stop the server.
- log::INFO("received signal. stopping server and finishing work.");
+ darner::log::INFO("received signal. stopping server and finishing work.");
srv.stop(); // stop accepting, wait for connections to all close out
- log::INFO("shut down. ciao.");
+ darner::log::INFO("shut down. ciao.");
return 0;
}
View
20 src/net/handler.cpp
@@ -33,18 +33,18 @@ void handler::start()
++stats_.conns_opened;
socket_.set_option(ip::tcp::no_delay(true));
- read_request(system::error_code(), 0);
+ read_request(boost::system::error_code(), 0);
}
-void handler::read_request(const system::error_code& e, size_t bytes_transferred)
+void handler::read_request(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
return error("read_request", e);
async_read_until(socket_, in_, '\n', bind(&handler::parse_request, shared_from_this(), _1, _2));
}
-void handler::parse_request(const system::error_code& e, size_t bytes_transferred)
+void handler::parse_request(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e == error::eof && !in_.size()) // clean close by client?
return;
@@ -124,7 +124,7 @@ void handler::set()
bind(&handler::set_on_read_chunk, shared_from_this(), _1, _2));
}
-void handler::set_on_read_chunk(const system::error_code& e, size_t bytes_transferred)
+void handler::set_on_read_chunk(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
return error("set_on_read_chunk", e);
@@ -150,7 +150,7 @@ void handler::set_on_read_chunk(const system::error_code& e, size_t bytes_transf
{
push_stream_.write(buf_);
}
- catch (const system::system_error& ex)
+ catch (const boost::system::system_error& ex)
{
return error("set_on_read_chunk", ex);
}
@@ -183,7 +183,7 @@ void handler::get()
{
pop_stream_.close(req_.get_close);
}
- catch (const system::system_error& ex)
+ catch (const boost::system::system_error& ex)
{
return error("get", ex);
}
@@ -206,7 +206,7 @@ void handler::get()
{
pop_stream_.read(buf_);
}
- catch (const system::system_error& ex)
+ catch (const boost::system::system_error& ex)
{
return error("get", ex);
}
@@ -222,7 +222,7 @@ void handler::get()
{
pop_stream_.close(!req_.get_peek);
}
- catch (const system::system_error& ex)
+ catch (const boost::system::system_error& ex)
{
return error("get_on_write_chunk", ex, false);
}
@@ -261,7 +261,7 @@ void handler::get_on_write_chunk(const boost::system::error_code& e, size_t byte
{
pop_stream_.close(!req_.get_peek);
}
- catch (const system::system_error& ex)
+ catch (const boost::system::system_error& ex)
{
return error("get_on_write_chunk", ex, false);
}
@@ -276,7 +276,7 @@ void handler::get_on_write_chunk(const boost::system::error_code& e, size_t byte
{
pop_stream_.read(buf_);
}
- catch (const system::system_error& ex)
+ catch (const boost::system::system_error& ex)
{
return error("get_on_write_chunk", ex, false);
}
View
4 src/queue/iqstream.cpp
@@ -15,7 +15,7 @@ iqstream::~iqstream()
bool iqstream::open(shared_ptr<queue> queue)
{
if (queue_)
- throw system::system_error(asio::error::already_open); // can't open what's open
+ throw boost::system::system_error(asio::error::already_open); // can't open what's open
if (!queue->pop_begin(id_))
return false;
@@ -32,7 +32,7 @@ void iqstream::read(string& result)
{
// not open or already read past end
if (!queue_ || chunk_pos_ >= header_.end)
- throw system::system_error(asio::error::eof);
+ throw boost::system::system_error(asio::error::eof);
if (!chunk_pos_) // first read? check if there's a header
{
View
6 src/queue/oqstream.cpp
@@ -32,7 +32,7 @@ oqstream::~oqstream()
void oqstream::open(boost::shared_ptr<queue> queue, queue::size_type chunks_count, bool sync)
{
if (queue_) // already open? that's a paddlin'
- throw system::system_error(asio::error::already_open);
+ throw boost::system::system_error(asio::error::already_open);
sync_ = sync;
queue_ = queue;
@@ -45,7 +45,7 @@ void oqstream::open(boost::shared_ptr<queue> queue, queue::size_type chunks_coun
void oqstream::write(const std::string& chunk)
{
if (!queue_ || chunk_pos_ == header_.end)
- throw system::system_error(asio::error::eof);
+ throw boost::system::system_error(asio::error::eof);
if (header_.end <= 1) // just one chunk? push it on
queue_->push(id_, chunk, sync_);
@@ -65,7 +65,7 @@ void oqstream::write(const std::string& chunk)
void oqstream::cancel()
{
if (!queue_)
- throw system::system_error(asio::error::eof); // not gon' do it
+ throw boost::system::system_error(asio::error::eof); // not gon' do it
if (header_.end > 1) // multi-chunk? erase them
queue_->erase_chunks(header_);
View
6 src/queue/queue.cpp
@@ -165,7 +165,7 @@ void queue::pop_read(std::string& result_item, header_type& result_header, id_ty
else if (result_item[result_item.size() - 2] == '\0') // \0 \0 means escaped \0
result_item.resize(result_item.size() - 1);
else
- throw system::system_error(system::errc::io_error,
+ throw boost::system::system_error(boost::system::errc::io_error,
boost::asio::error::get_system_category()); // anything else is bad data
}
}
@@ -243,15 +243,15 @@ void queue::wake_up()
}
}
-void queue::waiter_wakeup(const system::error_code& e, ptr_list<queue::waiter>::iterator waiter_it)
+void queue::waiter_wakeup(const boost::system::error_code& e, ptr_list<queue::waiter>::iterator waiter_it)
{
if (waiter_it == wake_up_it_) // did we time out on the next waiter in line? too bad.
++wake_up_it_;
ptr_list<waiter>::auto_type waiter = waiters_.release(waiter_it);
if (!returned_.empty() || queue_tail_.id < queue_head_.id)
- waiter->cb(system::error_code());
+ waiter->cb(boost::system::error_code());
else
waiter->cb(asio::error::timed_out);
}
View
6 src/util/log.cpp
@@ -9,18 +9,18 @@ using namespace boost;
using namespace boost::posix_time;
using namespace darner;
-log::log(mutex& mutex, ostream& out, const string& tag)
+darner::log::log(mutex& mutex, ostream& out, const string& tag)
: mutex_(mutex), out_(out), tag_(tag), enabled_(false)
{
}
-void log::enable(bool enabled)
+void darner::log::enable(bool enabled)
{
mutex::scoped_lock lock(mutex_);
enabled_ = enabled;
}
-void log::operator()(const string& format) const
+void darner::log::operator()(const string& format) const
{
if (!enabled_)
return;

No commit comments for this range

Something went wrong with that request. Please try again.