utility: temp fix for face already exists (409)
refs: #3976
Change-Id: I930ae5dae8938c83b7deff5079a499b7c5dcc639
diff --git a/src/utility/face-controller.cpp b/src/utility/face-controller.cpp
index c36490a..8e680d3 100644
--- a/src/utility/face-controller.cpp
+++ b/src/utility/face-controller.cpp
@@ -55,7 +55,18 @@
faceParameters.setUri(uri.toString());
_LOG_DEBUG("Creating Face in NFD with face-uri: " << uri);
- m_controller.start<ndn::nfd::FaceCreateCommand>(faceParameters, onSuccess, onFailure);
+ m_controller.start<ndn::nfd::FaceCreateCommand>(faceParameters, onSuccess,
+ [onSuccess, onFailure, uri] (const ndn::nfd::ControlResponse& response) {
+ ndn::nfd::ControlParameters faceParams(response.getBody());
+ if (response.getCode() == 409 && faceParams.getUri() == uri.toString()) {
+ _LOG_DEBUG("Got 409 - treating as success");
+ onSuccess(faceParams);
+ }
+ else {
+ onFailure(response);
+ }
+ }
+ );
}
void