Added out message queue for imv_msg receive method
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Andreas Steffen
|
||||
* Copyright (C) 2013-2014 Andreas Steffen
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -94,10 +94,14 @@ static TNC_Result receive_msg(private_imv_scanner_agent_t *this,
|
||||
ietf_attr_port_filter_t *port_filter_attr;
|
||||
bool fatal_error = FALSE;
|
||||
|
||||
/* generate an outgoing PA-TNC message - we might need it */
|
||||
out_msg = imv_msg_create_as_reply(in_msg);
|
||||
|
||||
/* parse received PA-TNC message and handle local and remote errors */
|
||||
result = in_msg->receive(in_msg, &fatal_error);
|
||||
result = in_msg->receive(in_msg, out_msg, &fatal_error);
|
||||
if (result != TNC_RESULT_SUCCESS)
|
||||
{
|
||||
out_msg->destroy(out_msg);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -121,17 +125,20 @@ static TNC_Result receive_msg(private_imv_scanner_agent_t *this,
|
||||
state->set_recommendation(state,
|
||||
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
||||
TNC_IMV_EVALUATION_RESULT_ERROR);
|
||||
out_msg = imv_msg_create_as_reply(in_msg);
|
||||
result = out_msg->send_assessment(out_msg);
|
||||
out_msg->destroy(out_msg);
|
||||
if (result != TNC_RESULT_SUCCESS)
|
||||
if (result == TNC_RESULT_SUCCESS)
|
||||
{
|
||||
return result;
|
||||
result = this->agent->provide_recommendation(this->agent, state);
|
||||
}
|
||||
return this->agent->provide_recommendation(this->agent, state);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* send PA-TNC message with the EXCL flag set */
|
||||
result = out_msg->send(out_msg, TRUE);
|
||||
}
|
||||
out_msg->destroy(out_msg);
|
||||
|
||||
return TNC_RESULT_SUCCESS;
|
||||
return result;
|
||||
}
|
||||
|
||||
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
||||
|
||||
Reference in New Issue
Block a user