summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/commands/trex_rpc_cmd_general.cpp
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-02-05 15:52:21 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-02-05 15:52:21 +0200
commit935de2a8ec8fce9f6b51cf10f7d4d1ed29625420 (patch)
tree158cf4615f9a901826edf7860db461390688c8c2 /src/rpc-server/commands/trex_rpc_cmd_general.cpp
parent3b430b906317d4114e5ebe3e35bdd0ac430a463a (diff)
WatchDog and IO functions: ensure we return it to normal timeout in case of exceptions in the middle of function.
Change-Id: I5d2e119f19c3e3214fdbe8108ea35af899ab49a5 Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'src/rpc-server/commands/trex_rpc_cmd_general.cpp')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_general.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_general.cpp b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
index d2546740..4d73714e 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_general.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
@@ -637,11 +637,9 @@ TrexRpcCmdPushRemote::_run(const Json::Value &params, Json::Value &result) {
}
- /* IO might take time, increase timeout of WD */
- TrexMonitor * cur_monitor = TrexWatchDog::getInstance().get_current_monitor();
- if (cur_monitor != NULL) {
- cur_monitor->io_begin();
- }
+ /* IO might take time, increase timeout of WD inside this function */
+ TrexWatchDog::IOFunction dummy;
+ (void)dummy;
try {
port->push_remote(pcap_filename, ipg_usec, min_ipg_sec, speedup, count, duration, is_dual);
@@ -649,11 +647,6 @@ TrexRpcCmdPushRemote::_run(const Json::Value &params, Json::Value &result) {
generate_execute_err(result, ex.what());
}
- /* revert timeout of WD */
- if (cur_monitor != NULL) {
- cur_monitor->io_end();
- }
-
result["result"] = Json::objectValue;
return (TREX_RPC_CMD_OK);