Diff for /libaitrpc/src/builtin.c between versions 1.12 and 1.22.2.2

version 1.12, 2013/03/07 23:10:50 version 1.22.2.2, 2015/07/22 12:49:10
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013Copyright 2004 - 2015
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 49  SUCH DAMAGE. Line 49  SUCH DAMAGE.
 /* builtin RPC server functions */  /* builtin RPC server functions */
   
 static int  static int
rpcServerClients(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcServerClients(RPC_CALL_STDARGS)
 {  {
         rpc_srv_t *srv;          rpc_srv_t *srv;
         rpc_cli_t *c;          rpc_cli_t *c;
Line 90  rpcServerClients(rpc_cli_t *cli, struct tagRPCCall *rp Line 90  rpcServerClients(rpc_cli_t *cli, struct tagRPCCall *rp
 }  }
   
 static int  static int
rpcServerCalls(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcServerCalls(RPC_CALL_STDARGS)
 {  {
         rpc_srv_t *srv;          rpc_srv_t *srv;
         rpc_func_t *f;          rpc_func_t *f;
Line 126  rpcServerCalls(rpc_cli_t *cli, struct tagRPCCall *rpc, Line 126  rpcServerCalls(rpc_cli_t *cli, struct tagRPCCall *rpc,
 }  }
   
 static int  static int
rpcServerSessions(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcServerSessions(RPC_CALL_STDARGS)
 {  {
         rpc_srv_t *srv;          rpc_srv_t *srv;
   
         RPC_CALLBACK_CHECK_INPUT(cli);          RPC_CALLBACK_CHECK_INPUT(cli);
         srv = RPC_SRV_SERVER(cli);          srv = RPC_SRV_SERVER(cli);
   
        AIT_SET_I32(ait_getVars(&RPC_RETVARS(cli), 3), array_Size(srv->srv_clients));        AIT_SET_I32(ait_getVars(&RPC_RETVARS(cli), 2), array_Size(srv->srv_clients));
         AIT_SET_U8(ait_getVars(&RPC_RETVARS(cli), 0), srv->srv_session.sess_version);          AIT_SET_U8(ait_getVars(&RPC_RETVARS(cli), 0), srv->srv_session.sess_version);
        AIT_SET_U32(ait_getVars(&RPC_RETVARS(cli), 1), srv->srv_session.sess_program);        AIT_SET_U8(ait_getVars(&RPC_RETVARS(cli), 1), srv->srv_session.sess_instance);
        AIT_SET_U8(ait_getVars(&RPC_RETVARS(cli), 2), srv->srv_session.sess_process); 
   
         return 0;          return 0;
 }  }
   
 static int  static int
rpcServerShutdown(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcServerShutdown(RPC_CALL_STDARGS)
 {  {
         rpc_srv_t *srv;          rpc_srv_t *srv;
   
         RPC_CALLBACK_CHECK_INPUT(cli);          RPC_CALLBACK_CHECK_INPUT(cli);
         srv = RPC_SRV_SERVER(cli);          srv = RPC_SRV_SERVER(cli);
                   
        rpc_freeCli(cli);        srv->srv_blob.kill = 1;
        if (srv->srv_blob.tid)
                 pthread_kill(srv->srv_blob.tid, SIGFBLOB);
         srv->srv_kill = 1;          srv->srv_kill = 1;
         return 0;          return 0;
 }  }
   
 static int  static int
rpcServerPing(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcServerPing(RPC_CALL_STDARGS)
 {  {
        if (rpc->call_req.flags == RPC_REPLY)        if (ntohl((u_long) rpc->call_req.flags) == RPC_REPLY)
                AIT_SET_U16(ait_getVars(&RPC_RETVARS(cli), 0), ntohs(rpc->call_seq));                AIT_SET_U16(ait_getVars(&RPC_RETVARS(cli), 0), random() % USHRT_MAX);
         return 0;          return 0;
 }  }
   
 /* ---------------------------------------------------- */  /* ---------------------------------------------------- */
   
 static int  static int
rpcBLOBServerShutdown(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcBLOBServerShutdown(RPC_CALL_STDARGS)
 {  {
         rpc_srv_t *srv;          rpc_srv_t *srv;
   
Line 180  rpcBLOBServerShutdown(rpc_cli_t *cli, struct tagRPCCal Line 180  rpcBLOBServerShutdown(rpc_cli_t *cli, struct tagRPCCal
 }  }
   
 static int  static int
rpcBLOBServerVars(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcBLOBServerVars(RPC_CALL_STDARGS)
 {  {
         rpc_srv_t *srv;          rpc_srv_t *srv;
         rpc_blob_t *b;          rpc_blob_t *b;
Line 223  rpcBLOBServerVars(rpc_cli_t *cli, struct tagRPCCall *r Line 223  rpcBLOBServerVars(rpc_cli_t *cli, struct tagRPCCall *r
 }  }
   
 static int  static int
rpcBLOBServerClients(rpc_cli_t *cli, struct tagRPCCall *rpc, array_t *iv)rpcBLOBServerClients(RPC_CALL_STDARGS)
 {  {
         rpc_srv_t *srv;          rpc_srv_t *srv;
         rpc_cli_t *c;          rpc_cli_t *c;
Line 275  rpcBLOBServerClients(rpc_cli_t *cli, struct tagRPCCall Line 275  rpcBLOBServerClients(rpc_cli_t *cli, struct tagRPCCall
  * @srv = RPC server instance   * @srv = RPC server instance
  * return: -1 error or 0 ok   * return: -1 error or 0 ok
  */   */
inline intint
 rpc_register_srvPing(rpc_srv_t * __restrict srv)  rpc_register_srvPing(rpc_srv_t * __restrict srv)
 {  {
         if (!srv)          if (!srv)

Removed from v.1.12  
changed lines
  Added in v.1.22.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>