[Opensrf-commits] r1529 - trunk/src/libopensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Dec 15 16:42:55 EST 2008


Author: erickson
Date: 2008-12-15 16:42:50 -0500 (Mon, 15 Dec 2008)
New Revision: 1529

Modified:
   trunk/src/libopensrf/osrf_stack.c
Log:
slight re-org of unknown client handling

Modified: trunk/src/libopensrf/osrf_stack.c
===================================================================
--- trunk/src/libopensrf/osrf_stack.c	2008-12-15 21:30:54 UTC (rev 1528)
+++ trunk/src/libopensrf/osrf_stack.c	2008-12-15 21:42:50 UTC (rev 1529)
@@ -66,24 +66,24 @@
 
 	osrfAppSession* session = osrf_app_session_find_session( msg->thread );
 
-    if(my_service) {
+    if( session && 
+        session->type == OSRF_SESSION_SERVER &&
+        (strcmp(msg->sender, session->remote_id) != 0) ) {
 
-        if(session) {
-            if(strcmp(msg->sender, session->remote_id) != 0) {
-                /* unexpected client connection.  See if we are running in "migratable" mode */
-                char* mable = osrf_settings_host_value("/apps/%s/migratable", my_service);
-                if(!mable) {
-                    osrfLogError("Connection to service %s from unknown client %s", my_service, msg->sender);
-                    return NULL;
-                }
-                free(mable);
-            }
-
+        /* unexpected client connection.  See if we are running in "migratable" mode */
+        char* mable = osrf_settings_host_value("/apps/%s/migratable", session->remote_service);
+        if(mable) {
+            // free to migrate
+            free(mable);
         } else {
-		    session = osrf_app_server_session_init(msg->thread, my_service, msg->sender);
+            osrfLogError("Connection to service %s from unknown client %s", session->remote_service, msg->sender);
+            return NULL;
         }
     }
 
+    if( !session && my_service )  
+        session = osrf_app_server_session_init( msg->thread, my_service, msg->sender); 
+
 	if( !session ) {
 		message_free( msg );
 		return NULL;



More information about the opensrf-commits mailing list