bool from_shell = ( L != nullptr );
current_request->respond(".. swapping configuration\n", from_shell);
- main_broadcast_command(new ACSwap(new Swapper(old, sc, old_tc, tc)), from_shell);
+ main_broadcast_command(new ACSwap(new Swapper(old, sc, old_tc, tc), current_request, from_shell), from_shell);
return 0;
}
bool from_shell = ( L != nullptr );
current_request->respond(".. swapping policy\n", from_shell);
- main_broadcast_command(new ACSwap(new Swapper(old, sc)), from_shell);
+ main_broadcast_command(new ACSwap(new Swapper(old, sc), current_request, from_shell), from_shell);
return 0;
}
bool from_shell = ( L != nullptr );
current_request->respond(".. swapping module\n", from_shell);
- main_broadcast_command(new ACSwap(new Swapper(old, sc)), from_shell);
+ main_broadcast_command(new ACSwap(new Swapper(old, sc), current_request, from_shell), from_shell);
return 0;
}
bool from_shell = ( L != nullptr );
current_request->respond(".. swapping hosts table\n", from_shell);
- main_broadcast_command(new ACSwap(new Swapper(old, tc)), from_shell);
+ main_broadcast_command(new ACSwap(new Swapper(old, tc), current_request, from_shell), from_shell);
return 0;
}
bool from_shell = ( L != nullptr );
current_request->respond(".. deleted inspector\n", from_shell);
- main_broadcast_command(new ACSwap(new Swapper(old, sc)), from_shell);
+ main_broadcast_command(new ACSwap(new Swapper(old, sc), current_request, from_shell), from_shell);
return 0;
}
#include "utils/stats.h"
#include "analyzer.h"
+#include "request.h"
#include "snort.h"
#include "snort_config.h"
#include "swapper.h"
DropStats();
}
-ACSwap::ACSwap(Swapper* ps) : ps(ps)
+ACSwap::ACSwap(Swapper* ps, Request* req, bool from_shell) : ps(ps), request(req), from_shell(from_shell)
{
assert(Swapper::get_reload_in_progress() == false);
Swapper::set_reload_in_progress(true);
delete ps;
Swapper::set_reload_in_progress(false);
snort::LogMessage("== reload complete\n");
+ request->respond("== reload complete\n", from_shell, true);
}
void ACDAQSwap::execute(Analyzer& analyzer)
// FIXIT-L supporting only simple strings for now
// could support var args formats
-void Request::respond(const char* s, bool queue_response)
+void Request::respond(const char* s, bool queue_response, bool remote_only)
{
+ if (remote_only && (fd == STDOUT_FILENO))
+ return;
+
if ( fd < 1 )
{
- snort::LogMessage("%s", s);
+ if (!remote_only)
+ snort::LogMessage("%s", s);
return;
}