-
lovetox
so anybody can help regarding my last question for jingle
-
lovetox
a session can have multiple contents
-
lovetox
how do i know when a content is finished transfering
-
lovetox
and the next begins
-
lovetox
do i need to negotiate transports for every content again?
-
flow
since the transports are a child element of content, i'd say yes
-
flow
also the available (or suited) transports may depend on the content
-
flow
for example, for real time audio, you may want to use a unreliable transport, which you certainly do not want to use for file transfer✎ -
flow
for example, for real-time audio you may want to use a unreliable transport, which you certainly do not want to use for file transfer ✏
-
lovetox
but you should not put both in one session
-
lovetox
so thats not really a supported usecase
-
flow
both what?
-
lovetox
filetransfer and realtime audio
-
flow
dunno
-
flow
it certainly is unusual
-
lovetox
lets think about something simpler
-
lovetox
i want to transfer 5 files to you
-
flow
but can't a jingle session modified at any point?✎ -
flow
but can't a jingle session be modified at any point? ✏
-
lovetox
i send a session with 5 content elements
-
lovetox
and then the first problem already begins
-
flow
A Jingle negotiation MAY result in the establishment of multiple file transfers by including multiple <content/> elements.
-
lovetox
my contact cant send me a candidate used, because he doesnt even know which content i want to transfer first
-
flow
so it looks like you can add 5 <descriptions> here
-
lovetox
that does also not work, because you have no way to signal the contact what file you are transfering of the 5
-
lovetox
he receives bytes, but does not know to which description they belong
-
flow
hmm reading xep234 i'd expect that the hash of the file is used to identify it in the transport
-
lovetox
he could try and match with size and hash afterwards, but i doubt that was intended
-
lovetox
sounds already like a workaround, and hashes are not mandatory
-
lovetox
i think..
-
lovetox
my next idea would be to add only one content, then if its finished i send a content-add action and send the next
-
lovetox
but then the contact can no approve all files before the transfer starts
-
lovetox
so again not really good
-
lovetox
weird that this is so underspecified for a file transfer protocol
-
flow
yep
-
flow
ahh wait
-
flow
the quoted text above says multiple *content* elements
-
lovetox
yeah i know
-
flow
so you identify the file via the sid attribute
-
lovetox
so, say i receive 5 contents
-
flow
that means that for multiple files jingle ft, <transport/> is usually duplicated, not nice, but works for me
-
lovetox
that means i start in parallel 5 negotiations for candidates
-
lovetox
then transfer all files at the same time
-
flow
right, then you have one session ID and multiple stream IDs
-
flow
potentially, sounds correct
-
lovetox
yeah would work, for some reason i thought its better to use one connection for all files
-
flow
but ideally you would send the files sequencially and not in parallel
-
lovetox
but actually thats not really better or worse, it does not really matter how many connections i use
-
lovetox
yeah but i can still do that
-
flow
and somehow re-use information obtained about which transport works both for subsequent files
-
lovetox
only cause i have negotiated candidates does not mean i have to send?
-
lovetox
but then the connection breaks down after some time i guess
-
lovetox
ah i simply could stall the candidate-use info
-
lovetox
hm no thats also not optimal
-
lovetox
i could do sequentially with conent-add action
-
lovetox
but this would trigger a needed content-accept on any new content
-
lovetox
it would work though if the other client has some auto-accept functionality
-
flow
we could add an optional feature to xep234 that allows multiple <file> elements in <description>
-
lovetox
the problem with that is, that you dont know when one file begins and the other ends
-
flow
not if size if provided for all files
-
lovetox
there is no "end of file" signal in jingle
-
lovetox
thats also not enough
-
flow
why not?
-
lovetox
you would need to specify the order also then
-
flow
sure, simply the order the <file> elements appear in <description>
-
lovetox
yes one could do that
-
lovetox
yeah that seems an easy extension
-
flow
of course the disadvantage would be that the recipient can not select files to receive individually✎ -
flow
of course the disadvantage would be, that the recipient can not select files to receive individually ✏
-
lovetox
we would just need a signal between that tells the other part which content should be negotiated
-
lovetox
so we dont have to do all in parallel
-
lovetox
start-negotiation sid=12313
-
flow
that sounds like a more fundamental change to jingle
-
lovetox
yeah not really backwards compatible
-
lovetox
ah wait i think i have it
-
lovetox
you start an empty file transfer session without content
-
lovetox
then issue content-add action 5 times instantly
-
lovetox
each content needs a content-accept, before anything can happen
-
flow
yep, or you start an empty file transfer with one content and 4x content-add✎ -
flow
yep, or you start an file transfer with one content and 4x content-add✎ ✏ -
lovetox
yes exactly
-
flow
yep, or you start a file transfer with one content and 4x content-add ✏
-
flow
I mean the first file transfer does not need to be empty
-
lovetox
yes
-
lovetox
hm but do we have a benefit here?
-
lovetox
now the user can instantly accept all files or reject single files
-
lovetox
but after he accepts, still all are transfered in parallel
-
lovetox
hm and its undefined if a content-add is valid on a not yet accepted session
-
lovetox
hm there is a flowchart https://xmpp.org/extensions/xep-0166.html#def-action-content-add
-
lovetox
not sure what this tells me
-
lovetox
ok all actions are allowed in pending session state
-
lovetox
but for filetransfer i see no benefit in doing content-add compared to just session-initiate
-
lovetox
i think i just do 5 sessions, and if the user does not want to download all in parallel
-
lovetox
he should just not accept all at the same time