or probably this one would do the trick for all protocols: if((!c->opt->protocol || !redirect(c)) && c->opt->protocol_middle) { c->opt->protocol_middle(c); }
or probably just: if(c->opt->protocol_middle && !redirect(c)) { c->opt->protocol_middle(c); }
---
Anyway, i'm not confident in all these fixes. Please help if you can.