/* Be prepared to create at least one HTX block by reserving its size
* and adjust <count> accordingly.
*/
+ if (max <= sizeof(struct htx_blk))
+ goto end;
max -= sizeof(struct htx_blk);
if (count > max)
count = max;
case H1_MSG_DATA:
new_chunk:
used = htx_used_space(*dsthtx);
-
- if (b_data(srcbuf) == ofs || !lmax)
+ if (b_data(srcbuf) == ofs || lmax <= sizeof(struct htx_blk))
break;
sz = b_data(srcbuf) - ofs;
uint64_t chksz;
struct htx_ret htxret;
+ lmax = *max;
+ if (lmax <= sizeof(struct htx_blk))
+ goto out;
+
/* source info :
* start : pointer at <ofs> position
* end : pointer marking the end of data to parse
* from <max>. Then we must adjust it if it exceeds the free size in the
* block.
*/
- lmax = *max;
if (!dpos)
lmax -= sizeof(struct htx_blk);
if (lmax > htx_get_blksz(htxret.blk) - dpos)
{
size_t sz, total = 0;
- if (b_data(srcbuf) == ofs || !max)
+ if (b_data(srcbuf) == ofs || max <= sizeof(struct htx_blk))
return 0;
if (h1m->flags & H1_MF_CLEN) {