Non-blocking Non-SASL example
I'll attach an example now. But take note that you will not be able to do cl.auth(user,passw,resource) anymore with this patch applied.
you will need to convert SASL to non-blocking mode as well and then develop some additional logic that will start either one auth process or other.