explicitly removing pre-existing connections when two overlap
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 2 Nov 2005 20:51:49 +0000 (20:51 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 2 Nov 2005 20:51:49 +0000 (20:51 +0000)
fixed typo

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@565 9efc2488-bf62-4759-914b-345cdb29e865

src/jserver/osrf_chat.c
src/jserver/osrf_chat.h

index 0a9b7e4..368ed96 100644 (file)
@@ -691,6 +691,10 @@ void osrfChatEndElement( void* blob, const xmlChar* name ) {
 
                                debug_handler("Setting remote address to %s", node->remote );
                                osrfChatSendRaw( node, OSRF_CHAT_LOGIN_OK );
+                               if(osrfHashGet( node->parent->nodeHash, node->remote ) ) {
+                                       warning_handler("New node replaces existing node for remote id %s", node->remote);
+                                       osrfHashRemove(node->parent->nodeHash, node->remote);
+                               }
                                osrfHashSet( node->parent->nodeHash, node, node->remote );
                                node->state = OSRF_CHAT_STATE_CONNECTED;
                        }
index 3e5446c..292e143 100644 (file)
@@ -90,8 +90,8 @@ GNU General Public License for more details.
 #define OSRF_CHAT_STATE_INIQ                           2
 #define OSRF_CHAT_STATE_INUSERNAME             4
 #define OSRF_CHAT_STATE_INRESOURCE             8
-#define OSRF_CHAT_STATE_INS2SRESULT            8
-#define OSRF_CHAT_STATE_INS2SVERIFY            8
+#define OSRF_CHAT_STATE_INS2SRESULT            16
+#define OSRF_CHAT_STATE_INS2SVERIFY            32
 
 
 struct __osrfChatNodeStruct {