예제 #1
0
int output_file_close(void *output_priv) {

	if (pload_listen_stop(output_priv, NULL) != POM_OK)
		return POM_ERR;

	struct output_file_priv *priv = output_priv;

	char *listen_pload_evt = PTYPE_BOOL_GETVAL(priv->p_listen_pload_evt);
	if (*listen_pload_evt)
		event_payload_listen_stop();

	return POM_OK;
}
예제 #2
0
// Called from lua to stop listening to a pload
static int addon_output_pload_listen_stop(lua_State *L) {
	// Args should be :
	// 1) self
	
	// Get the output
	struct addon_instance_priv *p = addon_output_get_priv(L, 1); // Stack : instance

	// Get the listening table
	lua_getfield(L, 1, "__pload_listener"); // Stack : instance, __pload_listener
	if (lua_isnil(L, 1))
		luaL_error(L, "The output is not listening for payloads");

	if (pload_listen_stop(p, NULL) != POM_OK)
		luaL_error(L, "Error while stopping payload listening");
	
	lua_pushnil(L); // Stack : instance, nil
	lua_setfield(L, 1, "__pload_listener"); // Stack : instance
	lua_pop(L, 1); // Stack : empty

	return 0;
}
예제 #3
0
static int analyzer_multipart_cleanup(struct analyzer *analyzer) {
	
	return pload_listen_stop(analyzer, ANALYZER_MULTIPART_PLOAD_TYPE);
}