Diff for /libaitrpc/src/cli.c between versions 1.11 and 1.12

version 1.11, 2012/07/22 20:44:13 version 1.12, 2012/11/13 09:22:10
Line 154  rpc_cli_openClient(u_int ProgID, u_char ProcID, int ne Line 154  rpc_cli_openClient(u_int ProgID, u_char ProcID, int ne
         if (netBuf < RPC_MIN_BUFSIZ)          if (netBuf < RPC_MIN_BUFSIZ)
                 netBuf = BUFSIZ;                  netBuf = BUFSIZ;
         else          else
                netBuf = io_align(netBuf, 1);      /* align netBuf length */                netBuf = io_align(netBuf, 2);      /* align netBuf length */
   
 #ifdef HAVE_SRANDOMDEV  #ifdef HAVE_SRANDOMDEV
         srandomdev();          srandomdev();
Line 379  rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short  Line 379  rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short 
   
         /* RPC is OK! Go de-marshaling variables ... */          /* RPC is OK! Go de-marshaling variables ... */
         if (out_vars && ntohs(rpc->call_argc)) {          if (out_vars && ntohs(rpc->call_argc)) {
   #ifdef CLI_RES_ZCOPY
                 *out_vars = io_buffer2vars(buf + wlen, AIT_LEN(&cli->cli_buf) - wlen,                   *out_vars = io_buffer2vars(buf + wlen, AIT_LEN(&cli->cli_buf) - wlen, 
                                   ntohs(rpc->call_argc), 42);
   #else
                   *out_vars = io_buffer2vars(buf + wlen, AIT_LEN(&cli->cli_buf) - wlen, 
                                 ntohs(rpc->call_argc), 0);                                  ntohs(rpc->call_argc), 0);
   #endif
                 if (!*out_vars) {                  if (!*out_vars) {
                         rpc_SetErr(io_GetErrno(), "%s", io_GetError());                          rpc_SetErr(io_GetErrno(), "%s", io_GetError());
                         return -1;                          return -1;
Line 392  rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short  Line 397  rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short 
 }  }
   
 /*  /*
    * rpc_cli_freeCall() - Free resouce allocated by RPC call
    *
    * @out_vars = Returned array with variables from RPC call
    * return: none
    */
   inline void
   rpc_cli_freeCall(array_t ** __restrict out_vars)
   {
   #ifdef CLI_RES_ZCOPY
           io_arrayDestroy(out_vars);
   #else
           io_freeVars(out_vars);
   #endif
   }
   
   /*
  * rpc_cli_ping() - Ping RPC server   * rpc_cli_ping() - Ping RPC server
  *   *
  * @cli = connected client   * @cli = connected client
Line 410  rpc_cli_ping(rpc_cli_t *cli) Line 431  rpc_cli_ping(rpc_cli_t *cli)
                 return -1;                  return -1;
         else          else
                 ret = AIT_GET_U16(io_array(arr, 0, ait_val_t*));                  ret = AIT_GET_U16(io_array(arr, 0, ait_val_t*));
        io_freeVars(&arr);        rpc_cli_freeCall(&arr);
   
         return ret;          return ret;
 }  }

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


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