mgmt+face: move protocol-specific face creation checks into protocol factories
Also brought implementation of faces/create in line with design
refs #3731
Change-Id: I4f48079136b42c7fdbd4fdfba37116d2565f9dc1
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 21943c8..163b0e9 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2016, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -151,7 +151,7 @@
NFD_LOG_DEBUG("[" << m_localEndpoint << "] Accept failed: " << error.message());
if (onAcceptFailed)
- onAcceptFailed(error.message());
+ onAcceptFailed(500, "Accept failed: " + error.message());
return;
}
@@ -189,7 +189,7 @@
socket->close();
if (onConnectFailed)
- onConnectFailed(error.message());
+ onConnectFailed(504, "Connect failed: " + error.message());
return;
}
@@ -209,7 +209,7 @@
socket->close(error);
if (onConnectFailed)
- onConnectFailed("Connect to remote endpoint timed out");
+ onConnectFailed(504, "Connect to remote endpoint timed out");
}
} // namespace nfd