[guardian-dev] first prototype of OTRDATA in pure otr4j
Hans-Christoph Steiner
hans at guardianproject.info
Fri Mar 20 22:12:33 EDT 2015
Hey all,
I finally got the OTRDATA transfer working in pure otr4j. I've been working
on ripping out all that code from ChatSecure, where it is working well, and
generalizing it into an API that is as easy as possible for other apps to include.
You can see the work I have so far in my git fork:
https://github.com/eighthave/otr4j
Right now, the API just works directly with java.io.File instances, but I hope
to also extend it to allow the use of InputStreams and OutputStreams, and
having the data actually stream to the other side as it is being written.
This will be much better for interactive data, like push-to-talk voice chat,
since the data will start being pushed to the other side as soon as it comes in.
In the current implementation, sending a hash of the whole file in the OFFER
request is required. That means that before the recipient can start playing
the file, these steps must happen:
0. record an entire audio message to a file
1. read the entire file and calculate a checksum
2. send an OFFER request
3. respond to GET requests from recipient
4. recipient must wait until entire file is received
5. read the entire file and calculate a checksum
6. now file is ready to play
I propose an optional streaming mode like this:
0. start recording an audio message
1. send an OFFER request while writing the file to disk
2. respond to GET requests from recipient
3. recipient can start playing the chunks immediately
4. recipient keeps playing until End-Of-File is received
.hc
--
PGP fingerprint: 5E61 C878 0F86 295C E17D 8677 9F0F E587 374B BE81
https://pgp.mit.edu/pks/lookup?op=vindex&search=0x9F0FE587374BBE81
More information about the guardian-dev
mailing list