Commit 9f0934c0 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2903] clarified one case after YIELD where the error shouldn't happen.

use assert() rather than ignoring it; we should be able to assert it safely
in this case.
parent 73bdf354
......@@ -14,13 +14,6 @@
#include <config.h>
#include <unistd.h> // for some IPC/network system calls
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
#include <boost/shared_array.hpp>
#include <log/dummylog.h>
#include <util/buffer.h>
......@@ -32,6 +25,14 @@
#include <asiodns/tcp_server.h>
#include <asiodns/logger.h>
#include <boost/shared_array.hpp>
#include <cassert>
#include <unistd.h> // for some IPC/network system calls
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
using namespace asio;
using asio::ip::udp;
using asio::ip::tcp;
......@@ -220,11 +221,11 @@ TCPServer::operator()(asio::error_code ec, size_t length) {
// Schedule a DNS lookup, and yield. When the lookup is
// finished, the coroutine will resume immediately after
// this point.
// this point. On resume, this method should be called with its
// default parameter values (because of the signature of post()'s
// handler), so ec shouldn't indicate any error.
CORO_YIELD io_.post(AsyncLookup<TCPServer>(*this));
if (ec) {
return;
}
assert(!ec);
// The 'done_' flag indicates whether we have an answer
// to send back. If not, exit the coroutine permanently.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment