diff options
author | Nick Hudson <nick.hudson@isode.com> | 2014-10-24 15:28:28 (GMT) |
---|---|---|
committer | Nick Hudson <nick.hudson@isode.com> | 2014-10-24 16:02:48 (GMT) |
commit | 244aff320257d178bbe35d87b0e09d939bd2f893 (patch) | |
tree | 6175d827be9bf72629016fb5ae166432ee65f94f /Makefile | |
parent | dabadc693220858ecb34af7e8df5f4e0b32461fc (diff) | |
download | stroke-244aff320257d178bbe35d87b0e09d939bd2f893.zip stroke-244aff320257d178bbe35d87b0e09d939bd2f893.tar.bz2 |
Don't disregard data that arrives on network just prior to socket closing
The JavaConnection code which reads from a socket detects a socket
closure and emits a disconnected signal.
It was noticed that on some occasions, data was arriving on the socket
just before it was closed, and this data was never passed to the
application.
This happens when the server writes e.g. a "BYE" message and closes
the socket straight away: when JavaConnection is woken to read the
message, it does so and then goes on to notice that the connection has
been closed and throws an IOException without passing the message back
to the application.
This patch fixes the problem by making sure that any data read prior
to the close being noticed is sent to the application before the closed
signal is emitted
Test-information:
It was possible to provoke the problem by deliberately breaking socket
connections - if you do this often enough you see cases where data
read from the socket is lost.
After this patch, such cases do not result in data loss.
Also tested with email client and verified that connections to
icloud.com which previously had provoked this problem when
authentication failed now seem to return all data reliably.
Change-Id: Ieba0f4186b7c91e55f5f1a4b3b64bc923006b933
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions