sasl_input(struct sasl_message *const restrict smsg)
{
	struct sasl_session *const p = sasl_session_find_or_make(smsg);

	bool ret = true;

	switch (smsg->mode)
	{
		case 'H':
			// (H)ost information
			(void) sasl_input_hostinfo(smsg, p);
			break;

		case 'S':
			// (S)tart authentication
			ret = sasl_input_startauth(smsg, p);
			break;

		case 'C':
			// (C)lient data
			ret = sasl_input_clientdata(smsg, p);
			break;

		case 'D':
			// (D)one -- when we receive it, means client abort
			(void) sasl_session_destroy(p);
			break;
	}

	if (! ret)
		(void) sasl_session_abort(p);
}
sasl_input(struct sasl_message *const restrict smsg)
{
	struct sasl_session *const p = sasl_session_find_or_make(smsg);

	bool ret = true;

	switch (smsg->mode)
	{
		case 'H':
			 
			(void) sasl_input_hostinfo(smsg, p);
			break;

		case 'S':
			 
			ret = sasl_input_startauth(smsg, p);
			break;

		case 'C':
			 
			ret = sasl_input_clientdata(smsg, p);
			break;

		case 'D':
			 
			(void) sasl_session_destroy(p);
			break;
	}

	if (! ret)
		(void) sasl_session_abort(p);
}