-
Notifications
You must be signed in to change notification settings - Fork 85
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
Config. variable max_xmpp_buffer_size not respected in current HEAD #23
Comments
Done. This actually limits the xmpp stanza size. We should also put in a limit for the buffer size - size of pending_stanzas. |
Thanks :) On Tue, Apr 3, 2012 at 1:47 AM, satyamshekhar
-Dhruv Matani. "What's the simplest thing that could possibly work?" |
Just wondering - suppose the limit on the packet size is 100 bytes and On Tue, Apr 3, 2012 at 9:16 AM, Dhruv Matani dhruvbird@gmail.com wrote:
-Dhruv Matani. "What's the simplest thing that could possibly work?" |
Yup, this check will not terminate that the stream in that case.. |
I am guessing that the check you have implemented is for buffer size limit. On Tue, Apr 3, 2012 at 2:56 PM, satyamshekhar
-Dhruv Matani. "What's the simplest thing that could possibly work?" |
No, this only checks the stanza size. _current_stanza_size is reset in function _on_stanza. To implement buffer size limit we will have to limit the size of pending_stanzas right? |
What I meant to say is that the current check does more than just the So in essence, it is limiting the amount of buffer space we allocate On Tue, Apr 3, 2012 at 3:05 PM, satyamshekhar
-Dhruv Matani. "What's the simplest thing that could possibly work?" |
Oh, now I get what you are saying.. Actually, not necessarily.. this depends on the network/node.js.. it might emit the data into diff chunks.. The size of the chunks is not decided by the remote server, is it? |
On Tue, Apr 3, 2012 at 3:17 PM, satyamshekhar
Exactly! So node itself might actually accumulate multiple packets and Actually, your last observation makes me thing that it is not entirely However, we can have a config variable which limits the amount of data
-Dhruv Matani. "What's the simplest thing that could possibly work?" |
It can accumulate packets in case current tick takes time.. What we can do is move the check after we write the incoming data to the parser.. that will limit the stanza size right? We can have another check that limits the chunk size.. Like you already suggested.. |
Sorry, wrong issue number :-/ |
@satyamshekhar @astro has pushed a feature to node-expat that allows one to query the number of bytes read in the stream till now. I've tried to fix the stanza limit restriction. Please could you review it for correctness. Caveat: It is possible that stanzas > the limit are accepted at times, but never will stanzas <= the limit be rejected. The logic is somewhat like a bloom filter. |
looks good. (y) |
Probably _on_data() & _on_stanza() should update a counter and maintain the buffer under max_xmpp_buffer_size.
The text was updated successfully, but these errors were encountered: