[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1994: If we get disconnected and there are any outstanding Receive (in trunk: . src/control)
Author: edmanm
Date: 2007-10-10 23:00:37 -0400 (Wed, 10 Oct 2007)
New Revision: 1994
Modified:
trunk/
trunk/src/control/controlconnection.cpp
Log:
r2052@lysithea: edmanm | 2007-10-10 23:00:29 -0400
If we get disconnected and there are any outstanding ReceiveWaiters, actually
remove them form the receive queue. Otherwise, the next time we connect to Tor
we would crash on the first message received because we'd be trying to call
setResult() on a ReceiveWaiter that had been deleted but was still in the
receive queue. Fixes ticket #295 reported by arma.
Property changes on: trunk
___________________________________________________________________
svk:merge ticket from /local/vidalia/trunk [r2052] on dc66be73-d13e-47ba-a267-8dc7cda68c65
Modified: trunk/src/control/controlconnection.cpp
===================================================================
--- trunk/src/control/controlconnection.cpp 2007-10-11 01:27:06 UTC (rev 1993)
+++ trunk/src/control/controlconnection.cpp 2007-10-11 03:00:37 UTC (rev 1994)
@@ -382,7 +382,8 @@
/* If there are any messages waiting for a response, clear them. */
_recvMutex.lock();
- foreach (ReceiveWaiter *w, _recvQueue) {
+ while (!_recvQueue.isEmpty()) {
+ ReceiveWaiter *w = _recvQueue.dequeue();
w->setResult(false, ControlReply(),
tr("Control socket is not connected."));
}