--- libaitrpc/src/builtin.c 2011/09/06 23:58:48 1.3.2.8 +++ libaitrpc/src/builtin.c 2011/09/07 00:30:04 1.3.2.9 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: builtin.c,v 1.3.2.8 2011/09/06 23:58:48 misho Exp $ +* $Id: builtin.c,v 1.3.2.9 2011/09/07 00:30:04 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -229,12 +229,21 @@ rpcBLOBServerVars(rpc_func_t *call, int ic, array_t *i else srv = call->func_parent; + rpc_srv_getVars(call, &vals); + + if (srv->srv_blob.state == kill) { + AIT_SET_STR(io_array(vals, 0, ait_val_t*), "BLOB Server is killed"); + return 1; + } + if (srv->srv_blob.state == disable) { + AIT_SET_STR(io_array(vals, 0, ait_val_t*), "BLOB Server is disabled"); + return 1; + } + pthread_mutex_lock(&srv->srv_blob.mtx); for (i = 0, b = srv->srv_blob.blobs; b; i++, b = b->blob_next); len = i * sizeof str; - rpc_srv_getVars(call, &vals); - if (!(val = malloc(len))) { LOGERR; pthread_mutex_unlock(&srv->srv_blob.mtx); @@ -295,6 +304,15 @@ rpcBLOBServerClients(rpc_func_t *call, int ic, array_t srv = call->func_parent; rpc_srv_getVars(call, &vals); + + if (srv->srv_blob.state == kill) { + AIT_SET_STR(io_array(vals, 0, ait_val_t*), "BLOB Server is killed"); + return 1; + } + if (srv->srv_blob.state == disable) { + AIT_SET_STR(io_array(vals, 0, ait_val_t*), "BLOB Server is disabled"); + return 1; + } len = srv->srv_numcli * STRSIZ; if (!(val = malloc(len))) {