speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Use correct variable name while processing message in speak().


From: Christopher Brannon
Subject: [PATCH] Use correct variable name while processing message in speak().
Date: Sun, 1 Aug 2010 12:08:48 -0500

A block of code processes current_message,
and it removes the sender of the message from fd_settings if the
sender's connection is closed.  However, several of the statements
in the block were acting on the "message" variable, rather than
the "current_message" variable.
In some cases, the wrong client record was being removed.
---
 src/server/speaking.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/server/speaking.c b/src/server/speaking.c
index 09ed02b..9d7d89c 100644
--- a/src/server/speaking.c
+++ b/src/server/speaking.c
@@ -213,8 +213,8 @@ speak(void* data)
                /* Check if the client who emited this message is disconnected
                   by now and this was his last message. If so, delete it's 
settings
                   from fdset */
-               if (get_client_settings_by_uid(message->settings.uid)->active 
== 0){
-                   if (!client_has_messages(message->settings.uid)){
+               if 
(get_client_settings_by_uid(current_message->settings.uid)->active == 0){
+                   if (!client_has_messages(current_message->settings.uid)){
                        MSG(4, "Removing client settings for uid %d", 
current_message->settings.uid);
                        
remove_client_settings_by_uid(current_message->settings.uid);
                    }
-- 
1.7.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]