Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
99c3c7f2
Commit
99c3c7f2
authored
Dec 12, 2012
by
Jelte Jansen
Browse files
[2494] Use non-throwing version of send_to
Also update log message and description
parent
a56f7ff8
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/asiodns/asiodns_messages.mes
View file @
99c3c7f2
...
...
@@ -53,6 +53,17 @@ The asynchronous I/O code encountered an error when trying to send data to
the specified address on the given protocol. The number of the system
error that caused the problem is given in the message.
% ASIODNS_UDP_SYNC_SEND_FAIL Error sending UDP packet to %1: %2
The low-level ASIO library reported an error when trying to send a UDP
packet in synchronous UDP mode. This can be any error reported by send_to(),
and can indicate problems such as too high a load on the network, or a
problem in the underlying library or system.
This packet is dropped and will not be sent, but service should resume
normally.
If you see a single occurrence of this message, it probably does not
indicate any significant problem, but if it is logged often, it is probably
a good idea to inspect your network traffic.
% ASIODNS_UNKNOWN_ORIGIN unknown origin for ASIO error code %1 (protocol: %2, address %3)
An internal consistency check on the origin of a message from the
asynchronous I/O module failed. This may indicate an internal error;
...
...
src/lib/asiodns/sync_udp_server.cc
View file @
99c3c7f2
...
...
@@ -148,9 +148,15 @@ SyncUDPServer::handleRead(const asio::error_code& ec, const size_t length) {
return
;
}
asio
::
error_code
ec
;
socket_
->
send_to
(
asio
::
buffer
(
output_buffer_
->
getData
(),
output_buffer_
->
getLength
()),
sender_
);
sender_
,
0
,
ec
);
if
(
ec
)
{
LOG_ERROR
(
logger
,
ASIODNS_UDP_SYNC_SEND_FAIL
).
arg
(
sender_
.
address
().
to_string
()).
arg
(
ec
.
message
());
}
}
// And schedule handling another socket.
...
...
src/lib/asiodns/udp_server.cc
View file @
99c3c7f2
...
...
@@ -299,7 +299,8 @@ UDPServer::operator()(asio::error_code ec, size_t length) {
// Begin an asynchronous send, and then yield. When the
// send completes, we will resume immediately after this point
// (though we have nothing further to do, so the coroutine
// will simply exit at that time).
// will simply exit at that time, after reporting an error if
// there was one).
CORO_YIELD
data_
->
socket_
->
async_send_to
(
buffer
(
data_
->
respbuf_
->
getData
(),
data_
->
respbuf_
->
getLength
()),
*
data_
->
sender_
,
*
this
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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