Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
1d88daaa
Commit
1d88daaa
authored
Mar 14, 2011
by
Jelte Jansen
Browse files
Merge branch 'trac589'
parents
40495506
41ef6df5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/asiolink/tcp_server.cc
View file @
1d88daaa
...
...
@@ -115,6 +115,7 @@ TCPServer::operator()(error_code ec, size_t length) {
CORO_YIELD
async_read
(
*
socket_
,
asio
::
buffer
(
data_
.
get
(),
TCP_MESSAGE_LENGTHSIZE
),
*
this
);
if
(
ec
)
{
socket_
->
close
();
CORO_YIELD
return
;
}
...
...
@@ -127,6 +128,7 @@ TCPServer::operator()(error_code ec, size_t length) {
}
if
(
ec
)
{
socket_
->
close
();
CORO_YIELD
return
;
}
...
...
@@ -160,6 +162,7 @@ TCPServer::operator()(error_code ec, size_t length) {
// If we don't have a DNS Lookup provider, there's no point in
// continuing; we exit the coroutine permanently.
if
(
lookup_callback_
==
NULL
)
{
socket_
->
close
();
CORO_YIELD
return
;
}
...
...
@@ -177,6 +180,9 @@ TCPServer::operator()(error_code ec, size_t length) {
// The 'done_' flag indicates whether we have an answer
// to send back. If not, exit the coroutine permanently.
if
(
!
done_
)
{
// TODO: should we keep the connection open for a short time
// to see if new requests come in?
socket_
->
close
();
CORO_YIELD
return
;
}
...
...
@@ -195,6 +201,10 @@ TCPServer::operator()(error_code ec, size_t length) {
// (though we have nothing further to do, so the coroutine
// will simply exit at that time).
CORO_YIELD
async_write
(
*
socket_
,
bufs
,
*
this
);
// TODO: should we keep the connection open for a short time
// to see if new requests come in?
socket_
->
close
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment