#include <haproxy/http-t.h>
#include <haproxy/htx-t.h>
+/* ->extra field value when the payload lenght is unknown (non-chunked message
+ * with no "Content-length" header)
+ */
+#define HTX_UNKOWN_PAYLOAD_LENGTH ULLONG_MAX
+
extern struct htx htx_empty;
struct htx_blk *htx_defrag(struct htx *htx, struct htx_blk *blk, uint32_t info);
}
/* If body length cannot be determined, set htx->extra to
- * ULLONG_MAX. This value is impossible in other cases.
+ * HTX_UNKOWN_PAYLOAD_LENGTH. This value is impossible in other cases.
*/
- htx->extra = ((h1m->flags & H1_MF_XFER_LEN) ? h1m->curr_len : ULLONG_MAX);
+ htx->extra = ((h1m->flags & H1_MF_XFER_LEN) ? h1m->curr_len : HTX_UNKOWN_PAYLOAD_LENGTH);
end:
return 1;
sl->info.res.status = code;
/* If body length cannot be determined, set htx->extra to
- * ULLONG_MAX. This value is impossible in other cases.
+ * HTX_UNKOWN_PAYLOAD_LENGTH. This value is impossible in other cases.
*/
- htx->extra = ((h1m->flags & H1_MF_XFER_LEN) ? h1m->curr_len : ULLONG_MAX);
+ htx->extra = ((h1m->flags & H1_MF_XFER_LEN) ? h1m->curr_len : HTX_UNKOWN_PAYLOAD_LENGTH);
end:
return 1;
if (type == HTX_BLK_DATA)
len += htx_get_blksz(blk);
}
- if (htx->extra != ULLONG_MAX)
+ if (htx->extra != HTX_UNKOWN_PAYLOAD_LENGTH)
len += htx->extra;
/* Stores the request path. */
if (type == HTX_BLK_DATA)
len += htx_get_blksz(blk);
}
- if (htx->extra != ULLONG_MAX)
+ if (htx->extra != HTX_UNKOWN_PAYLOAD_LENGTH)
len += htx->extra;
smp->data.type = SMP_T_SINT;
if (!(h2s->flags & H2_SF_OUTGOING_DATA) && count)
h2s->flags |= H2_SF_OUTGOING_DATA;
- if (htx->extra && htx->extra != ULLONG_MAX)
+ if (htx->extra && htx->extra != HTX_UNKOWN_PAYLOAD_LENGTH)
h2s->flags |= H2_SF_MORE_HTX_DATA;
else
h2s->flags &= ~H2_SF_MORE_HTX_DATA;