This name more accurately reminds that it applies to a channel and not
to a buffer, and that what is returned may be used as a max number of
bytes to pass to recv().
* is close to happen. The test is optimized to avoid as many operations as
* possible for the fast case.
*/
-static inline int bi_avail(const struct channel *chn)
+static inline int channel_recv_max(const struct channel *chn)
{
int ret;
* recv().
*/
while (!(conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_DATA_RD_SH | CO_FL_WAIT_ROOM | CO_FL_HANDSHAKE))) {
- max = bi_avail(chn);
+ max = channel_recv_max(chn);
if (!max) {
si->flags |= SI_FL_WAIT_ROOM;