-
User1773717
moparisthebest: I asked there about xmpp over websockets yesterday and got no response, do you have more info on that?
-
moparisthebest
doesn't support that right now, I suspect you'll be hard pressed to find a non-web client that does, may I ask why you want that?
-
Link Mauve
Gajim does though.
-
User1773717
> doesn't support that right now, I suspect you'll be hard pressed to find a non-web client that does, may I ask why you want that? I am confused, what do you exactly refer to with "why you want that?"?
-
adrien
User1773717: well, if the client can already easily establish a standard TLS connection above a TCP socket, there's no intetest to use websockets for me. Indeed with websockets, you can't manage stream data, you can only work by full message chunk.
-
Link Mauve
adrien, how is it an issue for XMPP?
-
adrien
There's no big problem I think, but it means you can't take advantage of buffering XMPP stream to an SAX xml parser directly. So, if you are able to manage the DNS, TLS and TCP stuff, I see no interest to propose to use WebSocket too.
-
jonas’
adrien, fwiw, you can also use SAX with WebSocket framing; just means you need to reset the parser state for each message to some extent.
-
adrien
Indeed, but if the message data is heavy, you can't buffer it to the parser, you have to store it entierly in some place.
-
jonas’
I suppose that depends on the websocket implementation
-
adrien
Nope, the XEP is clear about that: only full XMPP message must be sent
-
jonas’
soo?
-
jonas’
whether a websocket implementation allows you to stream the data into a streaming SAX parser is a websocket implementaiton detail, isn’t it?
-
adrien
Mmhh, I thought the Websocket `on_message` interface wasn't made to do streaming due to it's name.
-
jonas’
possibly
-
jonas’
also note that XMPP only guarantees stanza sizes up to 10 kB anyways; anything beyond that is implementation defined.
-
adrien
Nice, I didn't know about that limit. Now, I'm wondering how pubsub manage bigger data ☺
-
adrien
I have a lot to learn about xmpp :-)
-
Kev
XMPP says that a server's maximum stanza size must not be less than 10K.
-
Kev
You can phrase that as 'only guarantees stanza sizes up to 10K', but I think the give subtly different impressions.
-
jonas’
true
-
flow
adrien, I am not sure if xmpp impls ever should directly feed their network input to the parser
-
jonas’
flow, what’s the alternative?
-
flow
at least not without having some kind of stanza size enforcement in between
-
jonas’
I tend to disagree
-
flow
jonas’, maybe I did not a good job explaining what I mean. but if you just wrap the parser around the byte source, then you have no control over the stanza size and it often makes it harder to recover from an error
-
flow
here: byte source == the tcp socket
-
jonas’
with a SAX parser limits are pretty irrelevant, unless you store things somewhere. so you can simply "count" the size as you go while parsing, and when the data exceeds, you either kill the stream or forward (discarding data) until the end of the stanza
-
jonas’
(though the latter is very interesting with stream management)
-
adrien
Well, that's the SAX parser which should leverage error if it has consumed too many bytes.
-
adrien
jonas’: exactly :-)
-
jonas’
however, if you try to guess the stanza size before parsing with a proper XML parser, you end up re-doing much of the XML parsing.
-
jonas’
which sounds painful
-
flow
jonas’, I do mostly stax (pull) parsing, not sax (push) parsing, and there, counting the offset in the currently parsed stanza is some effort. is it easier with a typical sax API?
-
Kev
Even with pull it's relatively straightforward to say "There's been too much data read since the last stanza event" isn't it?
-
jonas’
I don’t care about bytes in the end
-
Kev
Which isn't the same as a cut-off at a precise point, but does the job.
-
jonas’
yeah, nodes is more interesting, though counting character data is also relevant
-
jonas’
but both is not much of a big deal
-
flow
Kev, sure you can always manually "count" the input. I ideally you want to able to tell the parser to set a mark and then be able to query the current offset from that mark✎ -
flow
Kev, sure you can always manually "count" the input. But I think ideally you want to able to tell the parser to set a mark and then be able to query the current offset from that mark ✏
-
flow
adrien, re how pubsub manages bigger data: pick at least one of: (1) not (2) don't care or (3) split into smaller (4KiB) chunks
-
moparisthebest
jonas’, sed to C translator written in sed : https://github.com/lhoursquentin/sed-bin