Building an OCaml list of string from C

You are making a block with two fields, each of which contains a string. This isn’t what a list looks like in OCaml.

A list looks like I said. In your case it will consist of two blocks with two fields. The two fields of the first block are: “h2” and the second block. The two fields of the second block are “http/1.1” and the immediate value 0.

It’s a linked list, not a vector.

(As a side comment, I had to change const unsigned char *protocol_buffer to const unsigned char protocol_buffer[] to get your code to compile.)

1 Like