Diff for /libaitrpc/src/srv.c between versions 1.17.4.5 and 1.17.4.8

version 1.17.4.5, 2013/08/21 12:59:12 version 1.17.4.8, 2013/08/21 15:28:16
Line 67  static sched_task_func_t cbProto[SOCK_RAW + 1][4] = { Line 67  static sched_task_func_t cbProto[SOCK_RAW + 1][4] = {
 };  };
   
   
static inline u_char *ait_val_t *
getBuffer(rpc_cli_t * __restrict c)rpc_getBufVar(rpc_cli_t * __restrict c)
 {  {
           return array(c->cli_buf, RPC_ISNEXTBUF(c), ait_val_t*);
   }
   
   u_char *
   rpc_getBuffer(rpc_cli_t * __restrict c)
   {
         u_char *b = NULL;          u_char *b = NULL;
   
         assert(c);          assert(c);
Line 83  getBuffer(rpc_cli_t * __restrict c) Line 89  getBuffer(rpc_cli_t * __restrict c)
         return b;          return b;
 }  }
   
static inline struct tagRPCCall *struct tagRPCCall *
getHeader(rpc_cli_t * __restrict c)rpc_getHeader(rpc_cli_t * __restrict c)
 {  {
         assert(c);          assert(c);
   
Line 255  execCall(sched_task_t *task) Line 261  execCall(sched_task_t *task)
         rpc_srv_t *s = c->cli_parent;          rpc_srv_t *s = c->cli_parent;
         rpc_func_t *f = NULL;          rpc_func_t *f = NULL;
         array_t *arr = NULL;          array_t *arr = NULL;
        u_char *buf = getBuffer(c);        u_char *buf = rpc_getBuffer(c);
        struct tagRPCCall *rpc = getHeader(c);        struct tagRPCCall *rpc = rpc_getHeader(c);
         int argc = ntohs(rpc->call_argc);          int argc = ntohs(rpc->call_argc);
   
         /* Go decapsulate variables ... */          /* Go decapsulate variables ... */
Line 494  rxUDPPacket(sched_task_t *task) Line 500  rxUDPPacket(sched_task_t *task)
         socklen_t salen;          socklen_t salen;
         struct timespec ts = { DEF_RPC_TIMEOUT, 0 };          struct timespec ts = { DEF_RPC_TIMEOUT, 0 };
   
         memset(buf, 0, AIT_LEN(bufz));  
         memset(&rpcbuf, 0, sizeof rpcbuf);          memset(&rpcbuf, 0, sizeof rpcbuf);
   
         /* receive connect packet */          /* receive connect packet */
Line 531  rxUDPPacket(sched_task_t *task) Line 536  rxUDPPacket(sched_task_t *task)
                         RPC_SET_NEXTBUF(c);                          RPC_SET_NEXTBUF(c);
                 }                  }
   
                rpc = getHeader(c);                rpc = rpc_getHeader(c);
                 memcpy(rpc, &rpcbuf, sizeof(struct tagRPCCall));                  memcpy(rpc, &rpcbuf, sizeof(struct tagRPCCall));
                memcpy(getBuffer(c), buf, len);                memcpy(rpc_getBuffer(c), buf, len);
   
                 c->cli_sock = TASK_FD(task);                  c->cli_sock = TASK_FD(task);
                 memcpy(&c->cli_sa, sa, sizeof c->cli_sa);                  memcpy(&c->cli_sa, sa, sizeof c->cli_sa);
Line 609  static void * Line 614  static void *
 txBLOB(sched_task_t *task)  txBLOB(sched_task_t *task)
 {  {
         rpc_cli_t *c = TASK_ARG(task);          rpc_cli_t *c = TASK_ARG(task);
        u_char *buf = AIT_GET_BUF(&c->cli_buf);        u_char *buf = AIT_GET_BUF(array(c->cli_buf, 0, ait_val_t*));
         int wlen = sizeof(struct tagBLOBHdr);          int wlen = sizeof(struct tagBLOBHdr);
   
         /* send reply */          /* send reply */
Line 701  rxBLOB(sched_task_t *task) Line 706  rxBLOB(sched_task_t *task)
         }          }
   
 end:  end:
        memcpy(AIT_ADDR(&c->cli_buf), &blob, sizeof blob);        memcpy(AIT_ADDR(array(c->cli_buf, 0, ait_val_t*)), &blob, sizeof blob);
         schedWrite(TASK_ROOT(task), txBLOB, TASK_ARG(task), TASK_FD(task), NULL, 0);          schedWrite(TASK_ROOT(task), txBLOB, TASK_ARG(task), TASK_FD(task), NULL, 0);
         schedReadSelf(task);          schedReadSelf(task);
         return NULL;          return NULL;

Removed from v.1.17.4.5  
changed lines
  Added in v.1.17.4.8


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