Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement maximum response length #41

Closed
wants to merge 1 commit into from

Conversation

Bituvo
Copy link

@Bituvo Bituvo commented Nov 23, 2023

This pull request limits the response length of the NIC (to prevent the "message too complex" error). By default, the maximum length is 5,000 characters. This does not affect JSON data.

@BuckarooBanzay BuckarooBanzay added the enhancement New feature or request label Nov 24, 2023
@OgelGames
Copy link
Contributor

to prevent the "message too complex" error

How exactly are you producing this error? I tested it just now and I had no issues receiving a message of 2,199,800 characters with a Luacontroller.

The digiline message length limit only applies to messages sent from a Luacontroller, which has nothing to do with the NIC.

@Bituvo
Copy link
Author

Bituvo commented Nov 25, 2023

How exactly are you producing this error? I tested it just now and I had no issues receiving a message of 2,199,800 characters with a Luacontroller.

The digiline message length limit only applies to messages sent from a Luacontroller, which has nothing to do with the NIC.

I was taking the last 324 or so characters of the response and sending it to another Luacontroller (which handles textlines).

@S-S-X
Copy link
Member

S-S-X commented Nov 25, 2023

I was taking the last 324 or so characters of the response and sending it to another Luacontroller (which handles textlines).

I think, if implemented, it should be chopped up into chunks and resulting chunks streamed instead of simply cutting at some obscure position.

This however could also be done with another digiline component, for example with single luacontroller as long as message is at most twice as much as luacontroller_memsize. If it is more than that then it'd need multiple memory chips (which can be luacontrollers or anything where you can store data).

But there's limit to this too, unless you're using digiline filter components, which is max heat until memory chips get burnt. With filters you can create enormous memory banks that can store chunks and do the streaming.

Also not that this is just an example for naive generic implementation. You can do more than that with single luac but what exactly depends on use case and configuration. However truncating and forwarding part of the string should be easily doable on single luac.

Copy link
Member

@S-S-X S-S-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this can be easily done on luac and isn't really needed at all.

I could approve if it included a way to actually get complete message instead of deleting part of it, currently this degrades NIC as it can handle longer content and luac or digilines are also able to handle a lot more than serialization limits.

@Bituvo Bituvo closed this Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants