MQTT 3.1 and 5 in OCaml using Eio
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Eliminate Obj.magic with type-safe equivalents

Replace unsafe Obj.magic casts with proper type-safe alternatives:

- conpool: Make protocol parameter required, add create_basic for simple
pools. The previous optional protocol with Obj.magic default was
fundamentally unsound as OCaml cannot have optional parameters that
change return types.

- publicsuffix: Add explicit id field to trie_node instead of using
Obj.magic to cast nodes to int for hashtable keys.

- yamlt: Add init_unknown_builder helper that properly handles GADT
refinement, returning () for Unknown_skip/Unknown_error cases where
builder=unit.

- jmap_brr: Use Jsont_brr.encode/decode Jsont.json instead of unsafe
casts between Jv.t and Jsont.json.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+1 -1
+1 -1
lib/cmd/mqtte_cmd.ml
··· 346 346 | Error (`Msg msg) -> failwith ("Failed to create TLS config: " ^ msg) 347 347 else None 348 348 in 349 - Conpool.create ~sw ~net ~clock ?tls:tls_config ~config:pool_config () 349 + Conpool.create_basic ~sw ~net ~clock ?tls:tls_config ~config:pool_config () 350 350 351 351 let endpoint conn = Conpool.Endpoint.make ~host:conn.host ~port:conn.port 352 352