-
Notifications
You must be signed in to change notification settings - Fork 99
Allow increasing recursion limit #166
Comments
The API seems reasonable.
Should this be an |
Marking it as I'm not morally opposed to marking it |
Another option could be to add a Deserializer::set_max_depth function as the Serde MessagePack library does. |
I think this crate already has to many features which cause problems because every new feature doubles the amount of build configurations. Sometimes the crate breaks if you have a specific combination of features and std/no-std enabled. |
Is this better than a simple opt-out from depth checking? Or asked another way: Are there people who know that their messages are at maximum nested 323 levels deep and want to set serde-cbor to this value? |
Yeah, that's totally fair, I didn't think of this.
My particular use case is that I have a server deserializing cbor messages generated by untrusted clients. For my specific application, the cbor messages generates are quite large by their nature. Setting the max recursion limit would be helpful because it would allow me to accept large cbor messages within reason, but still have a cap in the case of user abuse. So I guess to directly answer the question, I'm not sure if there are people who know exactly what depth their messages are, but there may be people who simply want to change the default for their use case. |
I'd merge a PR if you send one. |
I'm trying to deserialize very large CBOR files, and end up hitting the recursion limit of serde_cbor. Would it be possible to provide a way to increase or disable the recursion limit?
The related discussion in serde_json can be found here: serde-rs/json#334.
The approach they took was to add a
Deserializer::disable_recursion_limit
function.The text was updated successfully, but these errors were encountered: