send empty SDATA batch if no recommendation is available yet, but in order to avoid loops only if no empty CDATA batch was received

This commit is contained in:
Andreas Steffen
2012-07-11 17:09:05 +02:00
parent a5c79d0175
commit b8b678a567
4 changed files with 58 additions and 3 deletions
+11 -1
View File
@@ -632,7 +632,17 @@ METHOD(tls_t, build, status_t,
if (this->batch_type == PB_BATCH_NONE && this->is_server &&
state == PB_STATE_SERVER_WORKING)
{
check_and_build_recommendation(this);
if (this->state_machine->get_empty_cdata(this->state_machine) ||
this->recs->have_recommendation(this->recs, NULL, NULL))
{
check_and_build_recommendation(this);
}
else
{
DBG2(DBG_TNC, "no recommendation available yet, "
"sending empty PB-TNC SDATA batch");
this->batch_type = PB_BATCH_SDATA;
}
}
if (this->batch_type != PB_BATCH_NONE)