I have a patch to soreceive_stream to eliminate socket buffer contention, but before upstreaming that I need to ensure that I can actually enable soreceive_stream by default on TCP connections (it's currently an off by default tunable). The fact that soreceive_stream didn't actually work for X forwarding prior to my change this morning leads me to believe that this code hasn't been used much at all. Thus this should also be a request for more general review of soreceive_stream itself.
soreceive_dgram will:
/* * For any complicated cases, fall back to the full * soreceive_generic(). */ if (mp0 != NULL || (flags & MSG_PEEK) || (flags & MSG_OOB)) return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp));
This changes soreceive_stream to do the same. It also allows us to simplify the fast path code that checked for MSG_WAITALL and MSG_PEEK.