TRACE_ENTER(H1_EV_STRM_SEND, h1c->conn, h1s, 0, (size_t[]){count});
-
if (global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD_H1_SND) {
h1s->sd->iobuf.flags |= IOBUF_FL_NO_FF;
goto out;
else {
BUG_ON(h1m->state != H1_MSG_CHUNK_CRLF && h1m->state != H1_MSG_CHUNK_SIZE);
if (flags & NEGO_FF_FL_EXACT_SIZE) {
- if (!h1_make_chunk(h1s, h1m, count)) {
- h1s->sd->iobuf.flags |= IOBUF_FL_FF_BLOCKED;
- goto out;
+ /* Never emit a zero-sized chunk. It is the
+ * last-chunk, it would prematurely end the
+ * message. With <count> == 0, nothing will be
+ * forwarded, so no chunk is started.
+ */
+ if (count) {
+ if (!h1_make_chunk(h1s, h1m, count)) {
+ h1s->sd->iobuf.flags |= IOBUF_FL_FF_BLOCKED;
+ goto out;
+ }
+ h1m->curr_len = count;
+ h1s_consume_kop(h1s, h1m->curr_len);
}
- h1m->curr_len = count;
- h1s_consume_kop(h1s, h1m->curr_len);
}
else {
/* The producer does not know the chunk size, thus this will be emitted at the