> ! while ((len = m->b_rptr - m->b_wptr) <= off) {
Hmmm, are you sure you haven't got that around the wrong way ?
With the above, len is nearly always going to be < 0.
i.e. i think it should be:
while ((len = m->b_wptr - m->b_rptr) <= off) {
Cheers,
Darren
