small bug fixes
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 6 Sep 2005 14:22:39 +0000 (14:22 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 6 Sep 2005 14:22:39 +0000 (14:22 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@524 9efc2488-bf62-4759-914b-345cdb29e865

src/libstack/osrf_prefork.c
src/libstack/osrf_stack.c
src/libstack/osrf_system.c

index 0ac0f84..54be50e 100644 (file)
@@ -116,6 +116,7 @@ void prefork_child_process_request(prefork_child* child, char* data) {
        transport_message* msg = new_message_from_xml( data );
 
        osrfAppSession* session = osrf_stack_transport_handler(msg, child->appname);
+       if(!session) return;
 
        if( session->stateless && session->state != OSRF_SESSION_CONNECTED ) return;
 
index a8dfef8..53f3129 100644 (file)
@@ -32,6 +32,11 @@ osrfAppSession* osrf_stack_transport_handler( transport_message* msg, char* my_s
        debug_handler( "Transport handler received new message \nfrom %s "
                        "to %s with body \n\n%s\n", msg->sender, msg->recipient, msg->body );
 
+       if( msg->is_error && ! msg->thread ) {
+               warning_handler("!! Received jabber layer error for %s ... exiting\n", msg->sender );
+               return NULL;
+       }
+
        if(! msg->thread  && ! msg->is_error ) {
                warning_handler("Received a non-error message with no thread trace... dropping");
                message_free( msg );
@@ -39,7 +44,7 @@ osrfAppSession* osrf_stack_transport_handler( transport_message* msg, char* my_s
 
        osrf_app_session* session = osrf_app_session_find_session( msg->thread );
 
-       if( !session ) 
+       if( !session && my_service 
                session = osrf_app_server_session_init( msg->thread, my_service, msg->sender);
 
        if( !session ) return NULL;
index 97b2e59..a8609e7 100644 (file)
@@ -70,8 +70,10 @@ int osrfSystemBootstrap( char* hostname, char* configfile, char* contextNode ) {
 
                        } else {
        
-                               osrfAppRegisterApplication( appname, libfile );
-                               osrf_prefork_run(appname);
+                               if( osrfAppRegisterApplication( appname, libfile ) == 0 ) 
+                                       osrf_prefork_run(appname);
+
+                               debug_handler("Server exiting for app %s and library %s", appname, libfile );
                                exit(0);
                        }
                }