version 1.16, 2013/05/30 09:22:02
|
version 1.16.2.2, 2013/07/15 14:22:00
|
Line 559 closeBLOBClient(sched_task_t *task)
|
Line 559 closeBLOBClient(sched_task_t *task)
|
} |
} |
|
|
static void * |
static void * |
|
toutBLOB(sched_task_t *task) |
|
{ |
|
rpc_cli_t *c = TASK_ARG(task); |
|
|
|
rpc_srv_unregisterBLOB((rpc_srv_t*) c->cli_parent, (uint32_t) TASK_DATA(task)); |
|
|
|
return NULL; |
|
} |
|
|
|
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); |
Line 583 rxBLOB(sched_task_t *task)
|
Line 593 rxBLOB(sched_task_t *task)
|
rpc_blob_t *b; |
rpc_blob_t *b; |
struct tagBLOBHdr blob; |
struct tagBLOBHdr blob; |
int rlen; |
int rlen; |
|
struct timespec ts = { RPC_BLOB_TIMEOUT, 0 }; |
|
|
memset(&blob, 0, sizeof blob); |
memset(&blob, 0, sizeof blob); |
rlen = recv(TASK_FD(task), &blob, sizeof blob, 0); |
rlen = recv(TASK_FD(task), &blob, sizeof blob, 0); |
Line 632 rxBLOB(sched_task_t *task)
|
Line 643 rxBLOB(sched_task_t *task)
|
/* set new BLOB variable for reply :) */ |
/* set new BLOB variable for reply :) */ |
blob.hdr_var = htonl(b->blob_var); |
blob.hdr_var = htonl(b->blob_var); |
|
|
|
/* set live BLOB timeout */ |
|
ts.tv_sec = blob.hdr_ret ? blob.hdr_ret : RPC_BLOB_TIMEOUT; |
|
|
/* receive BLOB from client */ |
/* receive BLOB from client */ |
blob.hdr_ret = htonl(rpc_srv_recvBLOB(c, b)); |
blob.hdr_ret = htonl(rpc_srv_recvBLOB(c, b)); |
rpc_srv_blobUnmap(b); |
rpc_srv_blobUnmap(b); |
|
|
|
schedTimer(TASK_ROOT(task), toutBLOB, TASK_ARG(task), ts, |
|
(void*) (intptr_t) ntohl(blob.hdr_var), ntohl(blob.hdr_len)); |
} else { |
} else { |
blob.hdr_cmd = error; |
blob.hdr_cmd = error; |
blob.hdr_ret = RPC_ERROR(-1); |
blob.hdr_ret = RPC_ERROR(-1); |
Line 645 rxBLOB(sched_task_t *task)
|
Line 662 rxBLOB(sched_task_t *task)
|
blob.hdr_cmd = error; |
blob.hdr_cmd = error; |
blob.hdr_ret = RPC_ERROR(-1); |
blob.hdr_ret = RPC_ERROR(-1); |
} |
} |
|
|
|
schedCancelby(TASK_ROOT(task), taskTIMER, CRITERIA_DATA, |
|
(void*) (intptr_t) ntohl(blob.hdr_var), NULL); |
break; |
break; |
default: |
default: |
rpc_SetErr(EPROCUNAVAIL, "Unsupported BLOB command %d", blob.hdr_cmd); |
rpc_SetErr(EPROCUNAVAIL, "Unsupported BLOB command %d", blob.hdr_cmd); |