From: Andreas Steffen Date: Mon, 10 Jan 2011 06:22:02 +0000 (+0100) Subject: terminate TNCCS 1.1 connection after sending recommendation X-Git-Tag: 4.5.1~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=213281de0476f636bc4b63eb56bdd06933ab9c9f;p=thirdparty%2Fstrongswan.git terminate TNCCS 1.1 connection after sending recommendation --- diff --git a/src/libcharon/plugins/tnccs_11/tnccs_11.c b/src/libcharon/plugins/tnccs_11/tnccs_11.c index 9d3989bd8d..b5b2a8a34d 100644 --- a/src/libcharon/plugins/tnccs_11/tnccs_11.c +++ b/src/libcharon/plugins/tnccs_11/tnccs_11.c @@ -199,6 +199,19 @@ static void handle_message(private_tnccs_11_t *this, tnccs_msg_t *msg) chunk_create(lang, strlen(lang))); break; } + case TNCCS_MSG_REASON_STRINGS: + { + tnccs_reason_strings_msg_t *reason_msg; + chunk_t reason_string, reason_lang; + + reason_msg = (tnccs_reason_strings_msg_t*)msg; + reason_string = reason_msg->get_reason(reason_msg, &reason_lang); + DBG2(DBG_TNC, "reason string is '%.*s", reason_string.len, + reason_string.ptr); + DBG2(DBG_TNC, "reason language is '%.*s", reason_lang.len, + reason_lang.ptr); + break; + } default: break; } @@ -319,6 +332,9 @@ static void check_and_build_recommendation(private_tnccs_11_t *this) this->batch->add_msg(this->batch, msg); } enumerator->destroy(enumerator); + + /* we have reache the final state */ + this->delete_state = TRUE; } } @@ -359,7 +375,8 @@ METHOD(tls_t, build, status_t, /* Do not allow any asynchronous IMCs or IMVs to add additional messages */ this->mutex->lock(this->mutex); - if (this->is_server && (!this->batch || this->fatal_error)) + if (this->is_server && !this->delete_state && + (!this->batch || this->fatal_error)) { check_and_build_recommendation(this); }