on connect, we only connect if we're not already connected
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 31 Mar 2005 21:17:19 +0000 (21:17 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 31 Mar 2005 21:17:19 +0000 (21:17 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@262 9efc2488-bf62-4759-914b-345cdb29e865

src/libstack/osrf_app_session.c

index 30e5b23..f4da4b4 100644 (file)
@@ -461,6 +461,11 @@ int osrf_app_session_connect(osrf_app_session* session){
        if(session == NULL)
                return 0;
 
+       if(session->state == OSRF_SESSION_CONNECTED) {
+               debug_handler("Already Connected, returning");
+               return 1;
+       }
+
        int timeout = 5; /* XXX CONFIG VALUE */
 
        debug_handler( "AppSession connecting to %s", session->remote_id );