From 18b9155fb45dc024dbcda4e179c926a1d4e2b2aa Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 2 Mar 2005 17:16:48 +0000 Subject: [PATCH] fixed DISCONNECT message formatting in app_session, we don't resend if the request is complete git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@153 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libstack/osrf_app_session.c | 9 ++++++--- src/libstack/osrf_message.c | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libstack/osrf_app_session.c b/src/libstack/osrf_app_session.c index 8acba7e..06df3da 100644 --- a/src/libstack/osrf_app_session.c +++ b/src/libstack/osrf_app_session.c @@ -11,7 +11,7 @@ osrf_app_session* app_session_cache; // Request API // -------------------------------------------------------------------------- -/** Allocations and initializes a new app_request object */ +/** Allocation and initializes a new app_request object */ osrf_app_request* _osrf_app_request_init( osrf_app_session* session, osrf_message* msg ) { @@ -124,8 +124,11 @@ osrf_message* _osrf_app_request_recv( osrf_app_request* req, int timeout ) { /** Resend this requests original request message */ int _osrf_app_request_resend( osrf_app_request* req ) { if(req == NULL) return 0; - debug_handler( "Resending request [%d]", req->request_id ); - return _osrf_app_session_send( req->session, req->payload ); + if(!req->complete) { + debug_handler( "Resending request [%d]", req->request_id ); + return _osrf_app_session_send( req->session, req->payload ); + } + return 1; } diff --git a/src/libstack/osrf_message.c b/src/libstack/osrf_message.c index ad57e92..40067ff 100644 --- a/src/libstack/osrf_message.c +++ b/src/libstack/osrf_message.c @@ -222,7 +222,8 @@ char* osrf_message_to_xml( osrf_message* msg ) { break; case DISCONNECT: - xmlSetProp( type_node, BAD_CAST "type", "DISCONNECT" ); + xmlSetProp( type_node, BAD_CAST "name", BAD_CAST "type" ); + xmlSetProp( type_node, BAD_CAST "value", BAD_CAST "DISCONNECT" ); break; case STATUS: -- 2.11.0