explicitly removing pre-existing connections when two overlap
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Nov 2005 20:51:49 +0000 (20:51 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Nov 2005 20:51:49 +0000 (20:51 +0000)
fixed typo

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1947 dcc99617-32d9-48b4-a31d-7c20da2025e4

OpenSRF/src/jserver/osrf_chat.c
OpenSRF/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 {