aboutsummaryrefslogtreecommitdiffstats
path: root/apps/http-proxy/main.cc
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-03 14:47:16 +0000
committerGerrit Code Review <gerrit@fd.io>2020-06-03 14:47:16 +0000
commitf3f4f8cf18bf21c522e73571d183c95ef5dcb33c (patch)
tree0eb89fe5ed20ea42985f49a3f0d40f32db25ae0f /apps/http-proxy/main.cc
parent8340427544b3adedd57736fb13ca69c5549b6fc1 (diff)
parent5d8156ea4c34f9a3cb986da16a71faebfb2add6b (diff)
Merge "[HICN-622] Add stop() functionality to http proxy."
Diffstat (limited to 'apps/http-proxy/main.cc')
-rw-r--r--apps/http-proxy/main.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/http-proxy/main.cc b/apps/http-proxy/main.cc
index 8d407ba4c..d5052ef11 100644
--- a/apps/http-proxy/main.cc
+++ b/apps/http-proxy/main.cc
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-#include "src/http_proxy.h"
+#include <hicn/http-proxy/http_proxy.h>
using namespace transport;
@@ -41,13 +41,13 @@ struct Params : HTTPProxy::ClientParams, HTTPProxy::ServerParams {
<< "N Threads: " << n_thread << std::endl;
}
- HTTPProxy instantiateProxyAsValue() {
+ HTTPProxy* instantiateProxyAsValue() {
if (client) {
HTTPProxy::ClientParams* p = dynamic_cast<HTTPProxy::ClientParams*>(this);
- return transport::HTTPProxy(*p, n_thread);
+ return new transport::HTTPProxy(*p, n_thread);
} else if (server) {
HTTPProxy::ServerParams* p = dynamic_cast<HTTPProxy::ServerParams*>(this);
- return transport::HTTPProxy(*p, n_thread);
+ return new transport::HTTPProxy(*p, n_thread);
} else {
throw std::runtime_error(
"Proxy configured as client and server at the same time.");
@@ -134,8 +134,9 @@ int main(int argc, char** argv) {
}
params.printParams();
- transport::HTTPProxy proxy = params.instantiateProxyAsValue();
- proxy.run();
+ auto proxy = params.instantiateProxyAsValue();
+ proxy->run();
+ delete proxy;
return 0;
} \ No newline at end of file