[kopete-bugs] [Bug 212585] frequent error message: there was an unrecoverable error in the protocol
Stephan Krause
s_kraste at geord.net
Wed May 5 14:36:42 CEST 2010
https://bugs.kde.org/show_bug.cgi?id=212585
--- Comment #17 from Stephan Krause <s_kraste geord net> 2010-05-05 14:36:36 ---
Created an attachment (id=43267)
--> (http://bugs.kde.org/attachment.cgi?id=43267)
Proposed patch
I can confirm this bug relates to the sockettimeoutwatcher. There seem to be
three problems in the timeout check that, combined, lead to a false timeout
[From kopete/libkopete/kopetesockettimeoutwatcher.cpp]
if ( info.tcpi_last_ack_recv >= info.tcpi_last_data_sent &&
(info.tcpi_last_ack_recv - info.tcpi_last_data_sent) > mTimeoutThreshold )
1. (info.tcpi_last_ack_recv - info.tcpi_last_data_sent) is pretty arbitrary. If
the current ACK is not yet received, we check the time difference between the
ACK for the packet before and the current packet (which, on an idle connection,
is aprox 55sek). A much more useful check would be "Was the last send more than
mTimeoutThreshold ago?" (i.e. just info.tcpi_last_data_sent >
mTimeoutThreshold)
2. On a fast network (i.e. gigabit LAN and a local jabber server) due to the
limited accuracy of the times in the tcp_info struct the ack arrives with the
same timestamp als last_send, i.e. tcpi_last_ack_recv == tcpi_last_data_send.
So the check is triggered even if the ACK is already received.
3. If I understand the code correctly, the SocketTimeoutWatcher is supposed to
check mTimeoutThreshold after the last send if there was an ACK. However, I
noticed that ackTimeoutCheck was sometimes called almost imediately after the
sending of a packet, so that the ACK was not yet arrived and 1. triggered
The proposed fix is attached (it fixes 1. and 2., so the bug is not triggered
any more). I do not know why 3. happens, but if 1 and 2 are fixed, 3. is not
exactly pressing.
To be honest, I think the cleenest solution would be to use the tcp keepalive
as proposed by Stéphane Berthelot. But this is a quick fix without changing the
timeout architecture.
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the kopete-bugs
mailing list