--- libaitrpc/src/builtin.c 2013/05/30 09:22:01 1.14 +++ libaitrpc/src/builtin.c 2014/01/28 14:04:57 1.17.12.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: builtin.c,v 1.14 2013/05/30 09:22:01 misho Exp $ +* $Id: builtin.c,v 1.17.12.1 2014/01/28 14:04:57 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 +Copyright 2004 - 2014 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -151,14 +151,16 @@ rpcServerShutdown(rpc_cli_t *cli, struct tagRPCCall *r rpc_freeCli(cli); srv->srv_kill = 1; + if (srv->srv_blob.tid) + pthread_kill(srv->srv_blob.tid, SIGFBLOB); return 0; } static int rpcServerPing(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv) { - if (rpc->call_req.flags == RPC_REPLY) - AIT_SET_U16(ait_getVars(&RPC_RETVARS(cli), 0), ntohs(rpc->call_seq)); + if (ntohl((u_long) rpc->call_req.flags) == RPC_REPLY) + AIT_SET_U16(ait_getVars(&RPC_RETVARS(cli), 0), random() % USHRT_MAX); return 0; }