if (client->stream_pos == stream->bytes_received) {
// We don't have any more data for this client, so put it to sleep.
// This is postcondition #3.
stream->put_client_to_sleep(client);
if (client->stream_pos == stream->bytes_received) {
// We don't have any more data for this client, so put it to sleep.
// This is postcondition #3.
stream->put_client_to_sleep(client);