<table><tr><td style="">dfaure created this revision.<br />dfaure added reviewers: dvratil, kfunk.<br />Herald added a project: KDE PIM.<br />Herald added a subscriber: kde-pim.<br />dfaure requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29265">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The internal QWindowsPipeWriter in Qt doesn't do any buffering, so the first 8<br />
bytes (the tag) were sent first, and the rest only later.</p>

<p>This solution uses an explicit flush() method, while doing the flushing<br />
in the destructor would have been much more convenient and less<br />
error-prone, but the flushing can throw an exception, so we need<br />
to do it inside the try/catch -- and certainly not when the stream<br />
is deleted because another exception happened. This would all be<br />
so much simpler without the use of exceptions :-)</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>all tests pass (on Linux)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R165 Akonadi </div></div></div><br /><div><strong>BRANCH</strong><div><div>2020_04_implement_buffering_in_DataStream_for_Windows</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29265">https://phabricator.kde.org/D29265</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/private/protocoltest.h<br />
autotests/server/fakeakonadiserver.cpp<br />
autotests/server/fakeclient.cpp<br />
autotests/server/fakeclient.h<br />
src/core/connection.cpp<br />
src/private/datastream_p.cpp<br />
src/private/datastream_p_p.h<br />
src/private/protocol.cpp<br />
src/private/protocol_p.h<br />
src/private/protocolgen/cppgenerator.cpp<br />
src/server/connection.cpp<br />
src/server/connection.h<br />
src/server/notificationsubscriber.cpp</div></div></div><br /><div><strong>To: </strong>dfaure, dvratil, kfunk<br /><strong>Cc: </strong>kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>