#define HTX_FL_EOI 0x00000010 /* Set when end-of-input is reached from the HTX point of view
* (at worst, on the EOM block is missing)
*/
+#define HTX_FL_FRAGMENTED 0x00000020 /* Set when the HTX buffer is fragmented */
+
/* HTX block's type (max 15). */
enum htx_blk_type {
htx->tail = new - 1;
htx->head_addr = htx->end_addr = 0;
htx->tail_addr = addr;
+ htx->flags &= ~HTX_FL_FRAGMENTED;
memcpy((void *)htx->blocks, (void *)tmp->blocks, htx->size);
return ((blkpos == -1) ? NULL : htx_get_blk(htx, blkpos));
/* This is the last block in use */
if (htx->head == htx->tail) {
+ uint32_t flags = (htx->flags & ~HTX_FL_FRAGMENTED); /* Preserve flags except FRAGMENTED */
+
htx_reset(htx);
+ htx->flags = flags; /* restore flags */
return NULL;
}
blk = NULL;
goto end;
}
+ else
+ htx->flags |= HTX_FL_FRAGMENTED;
+
blk = htx_get_blk(htx, pos+1);
end:
struct htx_ret htxret = { .blk = NULL, .ret = 0 };
if (count == htx->data) {
- uint32_t flags = htx->flags;
+ uint32_t flags = (htx->flags & ~HTX_FL_FRAGMENTED); /* Preserve flags except FRAGMENTED */
htx_reset(htx);
htx->flags = flags; /* restore flags */