htx_add_blk_type_size() creates a block of a specified type and size
and returns it. The caller can then fill it.
const struct ist name, const struct ist value);
struct htx_blk *htx_add_header(struct htx *htx, const struct ist name, const struct ist value);
+struct htx_blk *htx_add_blk_type_size(struct htx *htx, enum htx_blk_type type, uint32_t blksz);
struct htx_blk *htx_add_all_headers(struct htx *htx, const struct http_hdr *hdrs);
struct htx_blk *htx_add_pseudo_header(struct htx *htx, enum htx_phdr_type phdr, const struct ist value);
struct htx_blk *htx_add_endof(struct htx *htx, enum htx_blk_type type);
return blk;
}
+/* Adds an HTX block of type <type> in <htx>, of size <blksz>. It returns the
+ * new block on success. Otherwise, it returns NULL. The caller is responsible
+ * for filling the block itself.
+ */
+struct htx_blk *htx_add_blk_type_size(struct htx *htx, enum htx_blk_type type, uint32_t blksz)
+{
+ struct htx_blk *blk;
+
+ blk = htx_add_blk(htx, type, blksz);
+ if (!blk)
+ return NULL;
+
+ blk->info += blksz;
+ return blk;
+}
+
struct htx_blk *htx_add_all_headers(struct htx *htx, const struct http_hdr *hdrs)
{
int i;