fixed DISCONNECT message formatting
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 2 Mar 2005 17:16:48 +0000 (17:16 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 2 Mar 2005 17:16:48 +0000 (17:16 +0000)
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
src/libstack/osrf_message.c

index 8acba7e..06df3da 100644 (file)
@@ -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;
 }
 
 
index ad57e92..40067ff 100644 (file)
@@ -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: