From: erickson Date: Sat, 9 Sep 2006 17:29:13 +0000 (+0000) Subject: finally implemented opensrf.system.echo[.atomic] - useful for nagios-style testing... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=433f9a99c18793798ef8edc974f9e1a10d5ceb43;p=opensrf%2Fbjwebb.git finally implemented opensrf.system.echo[.atomic] - useful for nagios-style testing against all C apps git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@784 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/libstack/osrf_application.c b/src/libstack/osrf_application.c index ad20ef6..eec1f30 100644 --- a/src/libstack/osrf_application.c +++ b/src/libstack/osrf_application.c @@ -367,6 +367,13 @@ int __osrfAppRunSystemMethod(osrfMethodContext* ctx) { return osrfAppIntrospect(ctx); } + if( !strcmp(ctx->method->name, OSRF_SYSMETHOD_ECHO ) || + !strcmp(ctx->method->name, OSRF_SYSMETHOD_ECHO_ATOMIC )) { + + return osrfAppEcho(ctx); + } + + osrfAppRequestRespondException( ctx->session, ctx->request, "System method implementation not found"); @@ -427,4 +434,13 @@ int osrfAppIntrospectAll( osrfMethodContext* ctx ) { return -1; } +int osrfAppEcho( osrfMethodContext* ctx ) { + OSRF_METHOD_VERIFY_CONTEXT(ctx); + int i; + for( i = 0; i < ctx->params->size; i++ ) { + jsonObject* str = jsonObjectGetIndex(ctx->params,i); + osrfAppRespond(ctx, str); + } + return 1; +} diff --git a/src/libstack/osrf_application.h b/src/libstack/osrf_application.h index 0f58e43..10f92ed 100644 --- a/src/libstack/osrf_application.h +++ b/src/libstack/osrf_application.h @@ -220,6 +220,7 @@ int osrfAppRespondComplete( osrfMethodContext* context, jsonObject* data ); int osrfAppIntrospect( osrfMethodContext* ctx ); int osrfAppIntrospectAll( osrfMethodContext* ctx ); +int osrfAppEcho( osrfMethodContext* ctx ); /**