Diff for /libaitrpc/src/blob.c between versions 1.7.2.3 and 1.7.2.6

version 1.7.2.3, 2012/05/16 08:20:26 version 1.7.2.6, 2012/05/16 14:46:29
Line 61  rpc_srv_blobCreate(rpc_srv_t * __restrict srv, int len Line 61  rpc_srv_blobCreate(rpc_srv_t * __restrict srv, int len
         int f;          int f;
         u_int rnd;          u_int rnd;
   
 #ifdef HAVE_SRANDOMDEV  
         srandomdev();  
 #else  
         time_t tim;  
   
         srandom((time(&tim) ^ getpid()));  
 #endif  
 again:  again:
         rnd = random() % UINT_MAX;          rnd = random() % UINT_MAX;
   
Line 289  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 282  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
         if (!cli || !var || !data) {          if (!cli || !var || !data) {
                 rpc_SetErr(EINVAL, "Invalid arguments");                  rpc_SetErr(EINVAL, "Invalid arguments");
                 return -1;                  return -1;
        }        } else
                 memset(&hdr, 0, sizeof hdr);
   
         rpc_addPktSession(&hdr.hdr_session, cli->cli_parent);          rpc_addPktSession(&hdr.hdr_session, cli->cli_parent);
         hdr.hdr_cmd = set;          hdr.hdr_cmd = set;
Line 301  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 295  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
         hdr.hdr_crc = htons(crcFletcher16((u_short*) &hdr, sizeof hdr / 2));          hdr.hdr_crc = htons(crcFletcher16((u_short*) &hdr, sizeof hdr / 2));
   
         /* send SET request */          /* send SET request */
        if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) {        if (send(cli->cli_sock, &hdr, sizeof hdr, MSG_NOSIGNAL) == -1) {
                 LOGERR;                  LOGERR;
                 return -1;                  return -1;
         }          }
   
         /* send BLOB to server */          /* send BLOB to server */
         for (ret = AIT_LEN(var), pos = data; ret > 0; ret -= len, pos += len)          for (ret = AIT_LEN(var), pos = data; ret > 0; ret -= len, pos += len)
                if ((len = send(cli->cli_sock, pos, ret, 0)) == -1) {                if ((len = send(cli->cli_sock, pos, ret, MSG_NOSIGNAL)) == -1) {
                         LOGERR;                          LOGERR;
                         return -1;                          return -1;
                 }                  }
Line 342  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 336  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
                         return 1;                          return 1;
                 }                  }
   
                var->val.blob = ntohl(hdr.hdr_var);                AIT_SET_BLOB(var, ntohl(hdr.hdr_var), ntohl(hdr.hdr_len));
         }          }
   
         return hdr.hdr_cmd == error;          return hdr.hdr_cmd == error;
Line 373  rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 367  rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, ait_val_t
         if (!*data) {          if (!*data) {
                 LOGERR;                  LOGERR;
                 return -1;                  return -1;
        } else        } else {
                 memset(&hdr, 0, sizeof hdr);
                 memset(*data, 0, AIT_LEN(var));                  memset(*data, 0, AIT_LEN(var));
           }
   
         rpc_addPktSession(&hdr.hdr_session, cli->cli_parent);          rpc_addPktSession(&hdr.hdr_session, cli->cli_parent);
         hdr.hdr_cmd = get;          hdr.hdr_cmd = get;
Line 468  rpc_cli_delBLOB(rpc_cli_t * __restrict cli, ait_val_t  Line 464  rpc_cli_delBLOB(rpc_cli_t * __restrict cli, ait_val_t 
         if (!cli || !var) {          if (!cli || !var) {
                 rpc_SetErr(EINVAL, "Invalid arguments");                  rpc_SetErr(EINVAL, "Invalid arguments");
                 return -1;                  return -1;
        }        } else
                 memset(&hdr, 0, sizeof hdr);
   
         rpc_addPktSession(&hdr.hdr_session, cli->cli_parent);          rpc_addPktSession(&hdr.hdr_session, cli->cli_parent);
         hdr.hdr_cmd = unset;          hdr.hdr_cmd = unset;
Line 480  rpc_cli_delBLOB(rpc_cli_t * __restrict cli, ait_val_t  Line 477  rpc_cli_delBLOB(rpc_cli_t * __restrict cli, ait_val_t 
         hdr.hdr_crc = htons(crcFletcher16((u_short*) &hdr, sizeof hdr / 2));          hdr.hdr_crc = htons(crcFletcher16((u_short*) &hdr, sizeof hdr / 2));
   
         /* send UNSET request */          /* send UNSET request */
        if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) {        if (send(cli->cli_sock, &hdr, sizeof hdr, MSG_NOSIGNAL) == -1) {
                 LOGERR;                  LOGERR;
                 return -1;                  return -1;
         }          }

Removed from v.1.7.2.3  
changed lines
  Added in v.1.7.2.6


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