mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Fix delayed event delivery when SASL is active
When SASL is active, it was possible that we read and decoded
more data off the wire than we initially wanted. The loop
processing this data terminated after only one message to
avoid delaying the calling thread, but this could delay
event delivery. As long as there is decoded SASL data in
memory, we must process it, before returning to the poll()
event loop.
This is a counterpart to the same kind of issue solved in
commit 68d2c3482f
in a different area of the code
* src/remote/remote_driver.c: Process all pending SASL data
This commit is contained in:
parent
e0d014f237
commit
635523f74a
@ -10376,12 +10376,27 @@ remoteIOHandleInput(virConnectPtr conn, struct private_data *priv,
|
||||
ret = processCallDispatch(conn, priv, flags);
|
||||
priv->bufferOffset = priv->bufferLength = 0;
|
||||
/*
|
||||
* We've completed one call, so return even
|
||||
* though there might still be more data on
|
||||
* the wire. We need to actually let the caller
|
||||
* deal with this arrived message to keep good
|
||||
* response, and also to correctly handle EOF.
|
||||
* We've completed one call, but we don't want to
|
||||
* spin around the loop forever if there are many
|
||||
* incoming async events, or replies for other
|
||||
* thread's RPC calls. We want to get out & let
|
||||
* any other thread take over as soon as we've
|
||||
* got our reply. When SASL is active though, we
|
||||
* may have read more data off the wire than we
|
||||
* initially wanted & cached it in memory. In this
|
||||
* case, poll() would not detect that there is more
|
||||
* ready todo.
|
||||
*
|
||||
* So if SASL is active *and* some SASL data is
|
||||
* already cached, then we'll process that now,
|
||||
* before returning.
|
||||
*/
|
||||
#if HAVE_SASL
|
||||
if (ret == 0 &&
|
||||
priv->saslconn &&
|
||||
priv->saslDecoded)
|
||||
continue;
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user