From 6036646abd793983ee2c53bf1adaa228a921fb3f Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 1 Apr 2005 17:03:56 +0000 Subject: [PATCH] added handling for jabber errors git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@265 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libstack/osrf_stack.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libstack/osrf_stack.c b/src/libstack/osrf_stack.c index a5cab97..e80b078 100644 --- a/src/libstack/osrf_stack.c +++ b/src/libstack/osrf_stack.c @@ -39,6 +39,27 @@ int osrf_stack_transport_handler( transport_message* msg ) { /* XXX ERROR CHECKING, BAD XML, ETC... */ int i; for( i = 0; i != num_msgs; i++ ) { + + + /* if we've received a jabber layer error message (probably talking to + someone who no longer exists) and we're not talking to the original + remote id for this server, consider it a redirect and pass it up */ + if(msg->is_error) { + warning_handler( "Received Jabber layer error message" ); + + if(strcmp(session->remote_id,session->orig_remote_id)) { + warning_handler( "Treating jabber error as redirect for tt [%d] " + "and session [%s]", arr[i]->thread_trace, session->session_id ); + + arr[i]->m_type = STATUS; + arr[i]->status_code = OSRF_STATUS_REDIRECTED; + + } else { + warning_handler(" * Jabber Error is for top level remote id [%s], no one " + "to send my message too!!!", session->remote_id ); + } + } + osrf_stack_message_handler( session, arr[i] ); } -- 2.11.0