added 'disconnect' to session requests
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 1 Mar 2005 21:49:15 +0000 (21:49 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 1 Mar 2005 21:49:15 +0000 (21:49 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@140 9efc2488-bf62-4759-914b-345cdb29e865

src/srfsh/srfsh.c

index 00bf13f..3eee7b3 100644 (file)
@@ -205,7 +205,7 @@ int send_request( char* server, char* method, growing_buffer* buffer ) {
        osrf_app_session* session = osrf_app_client_session_init(server);
        int req_id = osrf_app_session_make_request( session, params, method, 1 );
 
-       osrf_message* omsg = osrf_app_session_request_recv( session, req_id, 5 );
+       osrf_message* omsg = osrf_app_session_request_recv( session, req_id, 8 );
 
        if(!omsg) 
                printf("Received no data from server\n");
@@ -214,6 +214,7 @@ int send_request( char* server, char* method, growing_buffer* buffer ) {
        while(omsg) {
                if(omsg->result_content) 
                        printf( "Received Data: %s\n",json_object_to_json_string(omsg->result_content) );
+               osrf_message_free(omsg);
                omsg = osrf_app_session_request_recv( session, req_id, 5 );
        }
 
@@ -221,6 +222,8 @@ int send_request( char* server, char* method, growing_buffer* buffer ) {
        if( osrf_app_session_request_complete( session, req_id ))
                printf("[Request Completed Successfully]\n");
 
+       osrf_app_session_disconnect( session );
+
        return 1;