Fix flushing of sockets, causing random sync errors
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 12 Nov 2013 23:37:12 +0000 (00:37 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 12 Nov 2013 23:37:12 +0000 (00:37 +0100)
commit4c4aec75c42dc212b6725cf1cb42ab61fb09e8fd
tree0768d95cea893257e6142156708eb11f28a04773
parent121a7a9291abd0f49aab836a47c8afcae66da18e
Fix flushing of sockets, causing random sync errors

TIL that flushing a socket may trigger a readyRead(). In certain cases
this would lead to compression being enabled on the client side too late
(because we would flush the socket before), breaking the sync to core.

As (contrary to starting SSL) enabling the compression does not care if
there's still uncompressed data in the socket's write buffer, we can just
remove this flush.

Also, let's make it explicit that we flush immediately before starting
encryption, rather than hiding that somewhere in the LegacyPeer, to avoid
introducing weird bugs later. And also flush the socket before handing the
peer over to the CoreSession, as we used to do before the refactoring -
we don't want bug #682 back.
src/common/protocols/legacy/legacypeer.cpp
src/core/coreauthhandler.cpp