We want to make sure we won't emit another empty DATA frame if we meet
HTX_BLK_EOM after and end of stream was already sent. For now it cannot
happen as far as HTX is respected, but with trailers it may become
ambiguous.
count--;
goto end;
}
-
- if (type != HTX_BLK_DATA && type != HTX_BLK_EOM)
+ else if (type == HTX_BLK_EOM) {
+ if (h2s->flags & H2_SF_ES_SENT) {
+ /* ES already sent */
+ htx_remove_blk(htx, blk);
+ total++; // EOM counts as one byte
+ count--;
+ goto end;
+ }
+ }
+ else if (type != HTX_BLK_DATA)
goto end;
/* Perform some optimizations to reduce the number of buffer copies.