From: erickson Date: Tue, 6 Sep 2005 14:22:39 +0000 (+0000) Subject: small bug fixes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=01708a8b5b2632bb4c11f720ec17ad48fea5a127;p=opensrf%2Fbjwebb.git small bug fixes git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@524 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/libstack/osrf_prefork.c b/src/libstack/osrf_prefork.c index 0ac0f84..54be50e 100644 --- a/src/libstack/osrf_prefork.c +++ b/src/libstack/osrf_prefork.c @@ -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; diff --git a/src/libstack/osrf_stack.c b/src/libstack/osrf_stack.c index a8dfef8..53f3129 100644 --- a/src/libstack/osrf_stack.c +++ b/src/libstack/osrf_stack.c @@ -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; diff --git a/src/libstack/osrf_system.c b/src/libstack/osrf_system.c index 97b2e59..a8609e7 100644 --- a/src/libstack/osrf_system.c +++ b/src/libstack/osrf_system.c @@ -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); } }