implemented simple idle timeout on the server.

added --shutwr to the sample client code
This commit is contained in:
2018-03-22 07:15:19 +00:00
parent b6c306b93d
commit ad85c3d26a
3 changed files with 43 additions and 19 deletions

View File

@ -666,10 +666,11 @@ static int feed_reply_data (hcl_client_t* client, const hcl_bch_t* data, hcl_oow
}
ptr += taken;
client->rep.u.length_bounded_data.tally = taken;
client->rep.u.length_bounded_data.tally += taken;
if (taken == capa)
{
/* read all data. no more */
HCL_ASSERT (client->dummy_hcl, client->rep.u.length_bounded_data.max == client->rep.u.length_bounded_data.tally);
client->state = HCL_CLIENT_STATE_START;
if (client->prim.end_reply(client, HCL_CLIENT_END_REPLY_STATE_OK) <= -1) goto oops;
}