Diff for /libaitrpc/src/srv.c between versions 1.1.1.1.2.17 and 1.1.1.1.2.18

version 1.1.1.1.2.17, 2010/07/08 07:17:18 version 1.1.1.1.2.18, 2010/07/08 07:32:53
Line 179  rpc_srv_dispatchVars(void *arg) Line 179  rpc_srv_dispatchVars(void *arg)
         rpc_cli_t *c = arg;          rpc_cli_t *c = arg;
         rpc_srv_t *s;          rpc_srv_t *s;
         rpc_blob_t *b;          rpc_blob_t *b;
        int cx, ret;        int ret;
         fd_set fds;          fd_set fds;
         u_char buf[sizeof(struct tagBLOBHdr)];          u_char buf[sizeof(struct tagBLOBHdr)];
         struct tagBLOBHdr *blob;          struct tagBLOBHdr *blob;
Line 190  rpc_srv_dispatchVars(void *arg) Line 190  rpc_srv_dispatchVars(void *arg)
         } else          } else
                 s = c->cli_parent;                  s = c->cli_parent;
   
         cx = -1;  
         do {          do {
                 // check for disable service at this moment?                  // check for disable service at this moment?
                 if (s->srv_blob.state == disable) {                  if (s->srv_blob.state == disable) {
Line 203  rpc_srv_dispatchVars(void *arg) Line 202  rpc_srv_dispatchVars(void *arg)
                 ret = select(c->cli_sock + 1, &fds, NULL, NULL, NULL);                  ret = select(c->cli_sock + 1, &fds, NULL, NULL, NULL);
                 if (ret == -1) {                  if (ret == -1) {
                         ret = -2;                          ret = -2;
                } else                }
                        cx++;
                 memset(buf, 0, sizeof buf);                  memset(buf, 0, sizeof buf);
                 if ((ret = recv(c->cli_sock, buf, sizeof buf, 0)) == -1) {                  if ((ret = recv(c->cli_sock, buf, sizeof buf, 0)) == -1) {
                         LOGERR;                          LOGERR;
Line 222  rpc_srv_dispatchVars(void *arg) Line 221  rpc_srv_dispatchVars(void *arg)
                 } else                  } else
                         blob = (struct tagBLOBHdr*) buf;                          blob = (struct tagBLOBHdr*) buf;
                 // check BLOB packet session info                  // check BLOB packet session info
                if (memcmp(&blob->hdr_session, &s->srv_session, sizeof blob->hdr_session) ||                 if (memcmp(&blob->hdr_session, &s->srv_session, sizeof blob->hdr_session)) {
                                blob->hdr_seq != cx) {                        rpc_SetErr(EINVAL, "Error:: get invalid BLOB session ...\n");
                        rpc_SetErr(EINVAL, "Error:: get invalid BLOB session in seq=%d...\n", blob->hdr_seq); 
                         ret = -5;                          ret = -5;
                         goto makeReply;                          goto makeReply;
                 }                  }
Line 237  rpc_srv_dispatchVars(void *arg) Line 235  rpc_srv_dispatchVars(void *arg)
                                         ret = -6;                                          ret = -6;
                                         break;                                          break;
                                 }                                  }
                                 printf("++++++ %p\n", b);  
   
                                 if (rpc_srv_blobMap(s, b) != -1) {                                  if (rpc_srv_blobMap(s, b) != -1) {
                                         ret = rpc_srv_sendBLOB(c, b);                                          ret = rpc_srv_sendBLOB(c, b);
Line 265  rpc_srv_dispatchVars(void *arg) Line 262  rpc_srv_dispatchVars(void *arg)
                                                 blob->hdr_cmd);                                                  blob->hdr_cmd);
                                 ret = -7;                                  ret = -7;
                 }                  }
                 cx++;  
   
 makeReply:  makeReply:
                 // Replay to client!                  // Replay to client!
                 blob->hdr_cmd = ret < 0 ? error : ok;                  blob->hdr_cmd = ret < 0 ? error : ok;
                blob->hdr_seq = ret;                blob->hdr_ret = ret;
                 if ((ret = send(c->cli_sock, buf, sizeof buf, 0)) == -1) {                  if ((ret = send(c->cli_sock, buf, sizeof buf, 0)) == -1) {
                         LOGERR;                          LOGERR;
                         ret = -8;                          ret = -8;
Line 282  makeReply: Line 278  makeReply:
                         ret = -9;                          ret = -9;
                         break;                          break;
                 }                  }
                 cx = -1;  
   
         } while (ret > -1);          } while (ret > -1);
   
         shutdown(c->cli_sock, SHUT_RDWR);          shutdown(c->cli_sock, SHUT_RDWR);

Removed from v.1.1.1.1.2.17  
changed lines
  Added in v.1.1.1.1.2.18


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