Diff for /libaitrpc/src/blob.c between versions 1.7.2.7 and 1.7.2.8

version 1.7.2.7, 2012/05/17 15:14:16 version 1.7.2.8, 2012/05/17 21:40:02
Line 298  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 298  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 */
           pfd.fd = cli->cli_sock;
           pfd.events = POLLOUT;
           if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) == -1 || 
                           pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {
                   LOGERR;
                   return -1;
           }
         if (send(cli->cli_sock, &hdr, sizeof hdr, MSG_NOSIGNAL) == -1) {          if (send(cli->cli_sock, &hdr, sizeof hdr, MSG_NOSIGNAL) == -1) {
                 LOGERR;                  LOGERR;
                 return -1;                  return -1;
Line 311  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 318  rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
                 }                  }
   
         /* wait for reply */          /* wait for reply */
         pfd.fd = cli->cli_sock;  
         pfd.events = POLLIN | POLLPRI;          pfd.events = POLLIN | POLLPRI;
         if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 ||           if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || 
                         pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {                          pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {
Line 385  rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 391  rpc_cli_recvBLOB(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 GET request */          /* send GET request */
           pfd.fd = cli->cli_sock;
           pfd.events = POLLOUT;
           if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) == -1 || 
                           pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {
                   LOGERR;
                   free(*data);
                   *data = NULL;
                   return -1;
           }
         if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) {          if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) {
                 LOGERR;                  LOGERR;
                 free(*data);                  free(*data);
Line 393  rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, ait_val_t Line 408  rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, ait_val_t
         }          }
   
         /* receive BLOB from server */          /* receive BLOB from server */
         pfd.fd = cli->cli_sock;  
         pfd.events = POLLIN | POLLPRI;          pfd.events = POLLIN | POLLPRI;
         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 = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 ||                   if ((len = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || 
Line 480  rpc_cli_delBLOB(rpc_cli_t * __restrict cli, ait_val_t  Line 494  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 */
           pfd.fd = cli->cli_sock;
           pfd.events = POLLOUT;
           if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) == -1 || 
                           pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {
                   LOGERR;
                   return -1;
           }
         if (send(cli->cli_sock, &hdr, sizeof hdr, MSG_NOSIGNAL) == -1) {          if (send(cli->cli_sock, &hdr, sizeof hdr, MSG_NOSIGNAL) == -1) {
                 LOGERR;                  LOGERR;
                 return -1;                  return -1;
         }          }
   
         /* wait for reply */          /* wait for reply */
         pfd.fd = cli->cli_sock;  
         pfd.events = POLLIN | POLLPRI;          pfd.events = POLLIN | POLLPRI;
         if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 ||           if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || 
                         pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {                          pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {

Removed from v.1.7.2.7  
changed lines
  Added in v.1.7.2.8


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