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;
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 );
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;
} 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);
}
}