From b952c97eb683091f15511e78d773cd15985ec272 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 2 Nov 2005 20:51:49 +0000 Subject: [PATCH] explicitly removing pre-existing connections when two overlap fixed typo git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@565 9efc2488-bf62-4759-914b-345cdb29e865 --- src/jserver/osrf_chat.c | 4 ++++ src/jserver/osrf_chat.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jserver/osrf_chat.c b/src/jserver/osrf_chat.c index 0a9b7e4..368ed96 100644 --- a/src/jserver/osrf_chat.c +++ b/src/jserver/osrf_chat.c @@ -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; } diff --git a/src/jserver/osrf_chat.h b/src/jserver/osrf_chat.h index 3e5446c..292e143 100644 --- a/src/jserver/osrf_chat.h +++ b/src/jserver/osrf_chat.h @@ -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 { -- 2.11.0