From: erickson Date: Tue, 1 Mar 2005 21:49:15 +0000 (+0000) Subject: added 'disconnect' to session requests X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0687f04ce4f7bb2617474134c217bb0a1478ac5a;p=opensrf%2Fbjwebb.git added 'disconnect' to session requests git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@140 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/srfsh/srfsh.c b/src/srfsh/srfsh.c index 00bf13f..3eee7b3 100644 --- a/src/srfsh/srfsh.c +++ b/src/srfsh/srfsh.c @@ -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;