--- libaitrpc/src/srv.c 2013/07/15 14:16:52 1.16.2.1 +++ libaitrpc/src/srv.c 2013/07/15 15:10:38 1.16.2.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.16.2.1 2013/07/15 14:16:52 misho Exp $ +* $Id: srv.c,v 1.16.2.4 2013/07/15 15:10:38 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -559,16 +559,6 @@ closeBLOBClient(sched_task_t *task) } static void * -toutBLOB(sched_task_t *task) -{ - rpc_cli_t *c = TASK_DATA(task); - - rpc_srv_unregisterBLOB((rpc_srv_t*) c->cli_parent, (uint32_t) TASK_ARG(task)); - - return NULL; -} - -static void * txBLOB(sched_task_t *task) { rpc_cli_t *c = TASK_ARG(task); @@ -593,7 +583,6 @@ rxBLOB(sched_task_t *task) rpc_blob_t *b; struct tagBLOBHdr blob; int rlen; - struct timespec ts = { RPC_BLOB_TIMEOUT, 0 }; memset(&blob, 0, sizeof blob); rlen = recv(TASK_FD(task), &blob, sizeof blob, 0); @@ -639,20 +628,14 @@ rxBLOB(sched_task_t *task) } break; case set: - if ((b = rpc_srv_registerBLOB(s, ntohl(blob.hdr_len)))) { + if ((b = rpc_srv_registerBLOB(s, ntohl(blob.hdr_len), + ntohl(blob.hdr_ret), c))) { /* set new BLOB variable for reply :) */ 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 */ blob.hdr_ret = htonl(rpc_srv_recvBLOB(c, b)); rpc_srv_blobUnmap(b); - - schedTimer(TASK_ROOT(task), toutBLOB, - (void*) (intptr_t) ntohl(blob.hdr_var), ts, - TASK_ARG(task), ntohl(blob.hdr_len)); } else { blob.hdr_cmd = error; blob.hdr_ret = RPC_ERROR(-1); @@ -663,9 +646,6 @@ rxBLOB(sched_task_t *task) blob.hdr_cmd = error; blob.hdr_ret = RPC_ERROR(-1); } - - schedCancelby(TASK_ROOT(task), taskTIMER, CRITERIA_ARG, - (void*) (intptr_t) ntohl(blob.hdr_var), NULL); break; default: rpc_SetErr(EPROCUNAVAIL, "Unsupported BLOB command %d", blob.hdr_cmd);