[svn] commit: r2654 - in /branches/trac296/src: bin/msgq/msgq.py.in lib/cc/session.cc
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Aug 6 17:22:06 UTC 2010
Author: jelte
Date: Fri Aug 6 17:22:05 2010
New Revision: 2654
Log:
bit of cleanup
also make msgq recover from a crashing module
Modified:
branches/trac296/src/bin/msgq/msgq.py.in
branches/trac296/src/lib/cc/session.cc
Modified: branches/trac296/src/bin/msgq/msgq.py.in
==============================================================================
--- branches/trac296/src/bin/msgq/msgq.py.in (original)
+++ branches/trac296/src/bin/msgq/msgq.py.in Fri Aug 6 17:22:05 2010
@@ -212,7 +212,10 @@
EOF."""
received = b''
while len(received) < length:
- data = sock.recv(length - len(received))
+ try:
+ data = sock.recv(length - len(received))
+ except socket.error:
+ raise MsgQReceiveError(socket.error)
if len(data) == 0:
raise MsgQReceiveError("EOF")
received += data
Modified: branches/trac296/src/lib/cc/session.cc
==============================================================================
--- branches/trac296/src/lib/cc/session.cc (original)
+++ branches/trac296/src/lib/cc/session.cc Fri Aug 6 17:22:05 2010
@@ -86,7 +86,7 @@
// Sets the boolean pointed to by result to true, unless
// the given error code is operation_aborted
// Used as a callback for emulating sync reads with async calls
- void setResult(bool* result, asio::error_code* result_code, asio::error_code b);
+ void setResult(bool* result, asio::error_code* result_code, const asio::error_code& b);
private:
io_service& io_service_;
@@ -144,12 +144,11 @@
}
void
-SessionImpl::setResult(bool* result, asio::error_code* result_code, const asio::error_code b) {
- *result_code = b;
-
+SessionImpl::setResult(bool* result, asio::error_code* result_code, const asio::error_code& b) {
// if the 'error' is operation_aborted (i.e. a call to cancel()),
// we do not consider the read or the wait 'done'.
if (b != asio::error::operation_aborted) {
+ *result_code = b;
*result = true;
}
}
@@ -476,7 +475,7 @@
size_t
Session::getTimeout() {
- return impl_->getTimeout();
-}
-}
-}
+ return (impl_->getTimeout());
+}
+}
+}
More information about the bind10-changes
mailing list