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

version 1.1.1.1.2.14, 2010/07/07 09:29:42 version 1.1.1.1.2.18, 2010/07/08 07:32:53
Line 93  rpc_srv_dispatchCall(void *arg) Line 93  rpc_srv_dispatchCall(void *arg)
                         ret = -6;                          ret = -6;
                 } else                  } else
                         if ((ret = rpc_srv_execCall(f, rpc, v)) == -1)                          if ((ret = rpc_srv_execCall(f, rpc, v)) == -1)
                                ret = -6;                                ret = -9;
                         else                          else
                                 argc = rpc_srv_getValsCall(f, &vals);                                  argc = rpc_srv_getValsCall(f, &vals);
   
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 268  rpc_srv_dispatchVars(void *arg) Line 266  rpc_srv_dispatchVars(void *arg)
 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;

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


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