Open weinholt opened 11 years ago
Hi, thanks for opening a ticket. The older irssi-otr plugin also had a similair if not, the same problem. Feedback to the user whether the key generation was a success, a failure or simply hanging is quite important.. working on a fix.
Yah so I had a problem with spawning threads and printing stuff to irssi main window. It segfault inside some perl library (I can't remember exactly where). So, the trade off was to start the key generation in a thread that does no I/O on irssi side and update a flag when done before quitting. At each event, for instance "/otr contexts" or receiving a message, this flag is checked and if in a state that the key was generated, it prints out the message.
I'll be quite happy to have a better solution! I just don't have one for now :S.
Furthermore, if we look at other IMs like pidgin, the key creation freezes the current chat window until completion but not the rest if I'm not mistaken. Same for psi-plus. So, having a hang in the current chat window for which the otr session is being initialized is OK with me.
I'm not so sure whether it's even possible to freeze certain windows in Irssi. The least we should do is actually providing something like a window or statusbar to show at which stage the key generation is (busy, failed, OK)
Thoughts?
I think that the otr statusbar is already good for that. [plaintext/keygen/OTR, ...].
@viric Yes, I agree. Next to that, we should find out if this async generation of a key and chat works.
This is still an issue. Running into this problem right now.
Unfortunately there is no easy way out of this.... One thing that was suggested to me recently is to use the glib main loop for that key generation.
I'm not too familiar with it but this seems the most promising avenue.
I am currently testing a polling approach. I have a small "spinner" on statusbar widget showing that key generation is in progress. This can be updated frequently via a timer event until the key generation is finished.
Other things to do (that I haven't yet tried implementing):
And outside the scope of irssi-otr: figure out why it takes more than ten minutes to generate a key, and fix libotr and/or entropy generation accordingly if possible. There certainly are OTR implementations that work without a noticeable delay, too.
The key generation can hang irssi for the duration of the key generation. It can also finish early without notice. I believe that these two problems are different sides to the same coin.
To reproduce the hanging:
To reproduce the lag in notification:
Tested with irssi 0.8.15-5 and ibotr5 4.0.0-2 on Debian wheezy amd64 with irssi-otr v1.0.0-alpha1-5-g5f685aa from git.