From b797970e23e86f7db63d263ddc5a7b04baeb6747 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 26 Jan 2007 20:24:37 +0000 Subject: [PATCH] added timeout url param to set the request timeout git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@815 9efc2488-bf62-4759-914b-345cdb29e865 --- src/gateway/osrf_json_gateway.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gateway/osrf_json_gateway.c b/src/gateway/osrf_json_gateway.c index 1e0f1b5..b9262e0 100644 --- a/src/gateway/osrf_json_gateway.c +++ b/src/gateway/osrf_json_gateway.c @@ -114,6 +114,15 @@ static int osrf_json_gateway_method_handler (request_rec *r) { a_l = apacheGetFirstParamValue( params, "api_level" ); mparams = apacheGetParamValues( params, "param" ); /* free me */ + /* set the user defined timeout value */ + int timeout = 60; + char* tout = apacheGetFirstParamValue( params, "timeout" ); /* request timeout in seconds */ + if( tout ) { + timeout = atoi(tout); + osrfLogDebug(OSRF_LOG_MARK, "Client supplied timeout of %d", timeout); + } + + if (a_l) api_level = atoi(a_l); @@ -198,7 +207,7 @@ static int osrf_json_gateway_method_handler (request_rec *r) { char* statustext = NULL; char* output = NULL; - while((omsg = osrfAppSessionRequestRecv( session, req_id, 60 ))) { + while((omsg = osrfAppSessionRequestRecv( session, req_id, timeout ))) { statuscode = omsg->status_code; jsonObject* res; -- 2.11.0