From: erickson Date: Fri, 26 Jan 2007 20:24:37 +0000 (+0000) Subject: added timeout url param to set the request timeout X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=747c1b6230699eb3451c2284de056cc3d5b1da2f;p=Evergreen.git added timeout url param to set the request timeout git-svn-id: svn://svn.open-ils.org/ILS/trunk@6821 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/OpenSRF/src/gateway/osrf_json_gateway.c b/OpenSRF/src/gateway/osrf_json_gateway.c index 1e0f1b5aa5..b9262e0c68 100644 --- a/OpenSRF/src/gateway/osrf_json_gateway.c +++ b/OpenSRF/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;