buf->buf.i = 0;
buf->to_forward = 0;
buf->buf.p = buf->buf.data;
- buf->flags &= ~BF_FULL;
}
/* Cut the "tail" of the buffer, which means strip it to the length of unsent
return;
buf->buf.i = 0;
- buf->flags &= ~BF_FULL;
}
/* marks the buffer as "shutdown" ASAP for reads */
if (buffer_len(&buf->buf) == 0)
buf->buf.p = buf->buf.data;
- if (!channel_full(buf))
- buf->flags &= ~BF_FULL;
-
/* notify that some data was written to the SI from the buffer */
buf->flags |= BF_WRITE_PARTIAL;
}
* closed, -2 is returned. If the block is too large for this buffer, -3 is
* returned. If there is not enough room left in the buffer, -1 is returned.
* Otherwise the number of bytes copied is returned (0 being a valid number).
- * Buffer flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
- * transferred. The chunk's length is updated with the number of bytes sent.
+ * Buffer flag READ_PARTIAL is updated if some data can be transferred. The
+ * chunk's length is updated with the number of bytes sent.
*/
static inline int bi_putchk(struct channel *buf, struct chunk *chunk)
{
* closed, -2 is returned. If the block is too large for this buffer, -3 is
* returned. If there is not enough room left in the buffer, -1 is returned.
* Otherwise the number of bytes copied is returned (0 being a valid number).
- * Buffer flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
- * transferred.
+ * Buffer flag READ_PARTIAL is updated if some data can be transferred.
*/
static inline int bi_putstr(struct channel *buf, const char *str)
{
#define BF_READ_ERROR 0x000008 /* unrecoverable error on producer side */
#define BF_READ_ACTIVITY (BF_READ_NULL|BF_READ_PARTIAL|BF_READ_ERROR)
-#define BF_FULL 0x000010 /* channel cannot accept any more data (l >= max len) */
+/* unused: 0x000010 */
#define BF_SHUTR 0x000020 /* producer has already shut down */
#define BF_SHUTR_NOW 0x000040 /* the producer must shut down for reads ASAP */
#define BF_READ_NOEXP 0x000080 /* producer should not expire */
#define BF_MASK_ANALYSER (BF_READ_ATTACHED|BF_READ_ACTIVITY|BF_READ_TIMEOUT|BF_ANA_TIMEOUT|BF_WRITE_ACTIVITY|BF_WAKE_ONCE)
/* Mask for static flags which cause analysers to be woken up when they change */
-#define BF_MASK_STATIC (BF_FULL|BF_SHUTR|BF_SHUTW|BF_SHUTR_NOW|BF_SHUTW_NOW)
+#define BF_MASK_STATIC (BF_SHUTR|BF_SHUTW|BF_SHUTR_NOW|BF_SHUTW_NOW)
/* Analysers (channel->analysers).
global.maxrewrite, then we don't want to fill the buffer with more than
->size - global.maxrewrite + ->to_forward.
- Note that this also means that anyone touching ->to_forward must also take
- care of updating the BF_FULL flag. For this reason, it's really advised to
- use buffer_forward() only.
-
A buffer may contain up to 5 areas :
- the data waiting to be sent. These data are located between ->w and
->w+o ;
buf->buf.o += len;
buf->buf.p = b_ptr(&buf->buf, len);
buf->total += len;
-
- buf->flags &= ~BF_FULL;
- if (channel_full(buf))
- buf->flags |= BF_FULL;
-
return -1;
}
* ->o and to_forward pointers are updated. If the buffer's input is
* closed, -2 is returned. If there is not enough room left in the buffer, -1
* is returned. Otherwise the number of bytes copied is returned (1). Buffer
- * flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
- * transferred.
+ * flag READ_PARTIAL is updated if some data can be transferred.
*/
int bi_putchr(struct channel *buf, char c)
{
*bi_end(&buf->buf) = c;
buf->buf.i++;
- if (channel_full(buf))
- buf->flags |= BF_FULL;
buf->flags |= BF_READ_PARTIAL;
if (buf->to_forward >= 1) {
* closed, -2 is returned. If the block is too large for this buffer, -3 is
* returned. If there is not enough room left in the buffer, -1 is returned.
* Otherwise the number of bytes copied is returned (0 being a valid number).
- * Buffer flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
- * transferred.
+ * Buffer flag READ_PARTIAL is updated if some data can be transferred.
*/
int bi_putblk(struct channel *buf, const char *blk, int len)
{
b_adv(&buf->buf, fwd);
}
- buf->flags &= ~BF_FULL;
- if (channel_full(buf))
- buf->flags |= BF_FULL;
-
/* notify that some data was read from the SI into the buffer */
buf->flags |= BF_READ_PARTIAL;
return len;
b->buf.i += delta;
- b->flags &= ~BF_FULL;
if (buffer_len(&b->buf) == 0)
b->buf.p = b->buf.data;
- if (channel_full(b))
- b->flags |= BF_FULL;
return delta;
}
}
b->buf.i += delta;
-
- b->flags &= ~BF_FULL;
- if (channel_full(b))
- b->flags |= BF_FULL;
-
return delta;
}
b->flags |= BF_WRITE_PARTIAL;
- if (likely(!channel_full(b)))
- b->flags &= ~BF_FULL;
-
if (!b->buf.o) {
/* Always clear both flags once everything has been sent, they're one-shot */
b->flags &= ~(BF_EXPECT_MORE | BF_SEND_DONTWAIT);
max = bi_avail(b);
if (!max) {
- b->flags |= BF_FULL;
conn->flags |= CO_FL_WAIT_ROOM;
break;
}
b->xfer_large = 0;
}
- b->flags |= BF_FULL;
si->flags |= SI_FL_WAIT_ROOM;
break;
}