-
lovetox
when i send a stanza over the size limit, is the stream ended by the server?
-
lovetox
or is simply an error returned
-
moparisthebest
Stream has to be ended
-
moparisthebest
Well... In practice that's always going to be what happens
-
Zash
the stream is ended, along with all state, your user, your homework, your dog!
-
Zash
ALL ENDS
-
Zash
/s :)
-
lovetox
what was the rational behind that?
-
Zash
But stream and (xep-0198) session is unrecoverable
-
moparisthebest
In theory the server could read the rest of your huge stanza to /dev/null and return an error but seems funny
-
lovetox
why not simply reject that one stanza?
-
moparisthebest
How do you know it's gonna end?
-
moparisthebest
What if it's an unlimited length stanza
-
lovetox
ok, i understand, we need to abort the read, and we dont know how much else was behind that stanza
-
Zash
What is communicated is the hard limit. It existed already, but now you know it.
-
lovetox
could be multiple stanzas
-
Zash
No behavior changes.
-
lovetox
and then we are in an inconsistent state
-
lovetox
Zash, the behavior changes on client side
-
Zash
Only that you can now take steps to avoid being brutally </stream>'d when you send something too big
-
lovetox
i need to decide if i let a user send a stanza over the limit, or reject it
-
Zash
You can raise an exception earlier before the stanza actually kills the stream.
-
lovetox
so because stream end is rather bad, the lib should not send a stanza over the limit
-
Zash
This was already what happened if you hit the limit.
-
Zash
You just got </stream>'d as a random surprise before.
-
lovetox
yes, but my thinking was, if the server does not end the stream, simply returns an error
-
Zash
No
-
lovetox
then a lib does not need to check
-
Zash
I don't see how this is possible with the current parser stack.
-
lovetox
im not saying it is possible
-
lovetox
i didnt know
-
Zash
nor do I want it to be possible
-
lovetox
and i asked to decide on the behavior of the lib
-
Zash
Wasn't someone working on this, for nbxmpp even?
-
Zash
They were asking in the Prosody channel the other day.
-
lovetox
yes i have a MR, and need to review it :)
-
lovetox
its a rather big change, because suddenly the send() method can raise an exception when it was not possible before ..
-
mjk
๐
-
Zash
yes. those kinds of changes are "fun" to review, when the ground may change below your feet
-
Zash
couldn't the send() method fail before?
-
Zash
like, the socket turned out to have been broken or something
-
Zash
altho stream management could absorb that
-
mjk
it's async, so... it's complicated
-
lovetox
its just much work, many parts call send_stanza() and this method did not raise exceptions, and now it does, so you need to wrap many calls in try/except blocks
-
Zash
mmmm, and I'm not sure I've finished all that behavior in Prosody yet. it has the same kind of problem with s2s connections
-
mjk
the only exceptions send() could generate before are type system related, I think :D
-
singpolyma
Even more fun, send something under your c2s limit but over your peer's s2s and get the whole s2s stream terminated for everyone!
-
moparisthebest
Exceptions were a mistake :)
-
Zash
singpolyma, but now you can know that something is over the limit and turn it into a stanza error before sending it :)
-
Zash
you could do something like that internally in a client too
-
MattJ
XEP-0478 <3
-
singpolyma
Zash: how would you know? Since the limit is set by up to two remote parties who don't tell you their limits
-
Zash
singpolyma, seen https://xmpp.org/extensions/xep-0478.html ?
-
Zash
working name "Path MTU" :)
-
MattJ
singpolyma, if everyone supports '478 then there is no stream closure case now
-
moparisthebest
Yep, very excited about that
-
singpolyma
Oh I see, that does indeed fix the s2s case I mentioned
-
emus
*The XMPP Newsletter April 2023* https://xmpp.org/2023/05/the-xmpp-newsletter-april-2023/
-
moparisthebest
Great job as usual emus and team
-
emus
๐งก