|
version 1.12.2.8, 2012/11/19 15:48:45
|
version 1.12.2.11, 2012/11/19 21:35:43
|
|
Line 71 inline void
|
Line 71 inline void
|
| rpc_freeCli(rpc_cli_t * __restrict c) |
rpc_freeCli(rpc_cli_t * __restrict c) |
| { |
{ |
| rpc_srv_t *s = c->cli_parent; |
rpc_srv_t *s = c->cli_parent; |
| ait_val_t v; |
|
| |
|
| printf("_t_1=%p t_e=%p so=%d c=%p %s:%hu\n", s->srv_root->root_timer.tqh_first, *s->srv_root->root_timer.tqh_last, c->cli_sock, c, io_n2addr(&c->cli_sa, &v), io_n2port(&c->cli_sa)); |
|
| AIT_FREE_VAL(&v); |
|
| schedCancelby(s->srv_root, taskMAX, CRITERIA_ARG, c, NULL); |
schedCancelby(s->srv_root, taskMAX, CRITERIA_ARG, c, NULL); |
| printf("+t_1=%p t_e=%p so=%d c=%p\n", s->srv_root->root_timer.tqh_first, *s->srv_root->root_timer.tqh_last, c->cli_sock, c); |
|
| |
|
| /* free buffer */ |
/* free buffer */ |
| AIT_FREE_VAL(&c->cli_buf); |
AIT_FREE_VAL(&c->cli_buf); |
|
Line 525 end:
|
Line 521 end:
|
| |
|
| /* ------------------------------------------------------ */ |
/* ------------------------------------------------------ */ |
| |
|
| static void * | inline void |
| closeBLOBClient(sched_task_t *task) | rpc_freeBLOBCli(rpc_cli_t * __restrict c) |
| { |
{ |
| rpc_cli_t *c = TASK_ARG(task); |
|
| rpc_srv_t *s = c->cli_parent; |
rpc_srv_t *s = c->cli_parent; |
| |
|
| schedCancelby(TASK_ROOT(task), taskMAX, CRITERIA_ARG, TASK_ARG(task), NULL); | schedCancelby(s->srv_blob.root, taskMAX, CRITERIA_ARG, c, NULL); |
| |
|
| /* close client socket */ |
|
| if (TASK_VAL(task)) |
|
| shutdown(c->cli_sock, SHUT_RDWR); |
|
| close(c->cli_sock); |
|
| |
|
| /* free buffer */ |
/* free buffer */ |
| AIT_FREE_VAL(&c->cli_buf); |
AIT_FREE_VAL(&c->cli_buf); |
| |
|
| io_arrayDel(s->srv_blob.clients, c->cli_id, 0); |
io_arrayDel(s->srv_blob.clients, c->cli_id, 0); |
| if (c) |
if (c) |
| io_free(c); |
io_free(c); |
| |
} |
| |
|
| |
|
| |
static void * |
| |
closeBLOBClient(sched_task_t *task) |
| |
{ |
| |
int sock = ((rpc_cli_t*) TASK_ARG(task))->cli_sock; |
| |
|
| |
rpc_freeBLOBCli(TASK_ARG(task)); |
| |
|
| |
/* close client socket */ |
| |
shutdown(sock, SHUT_RDWR); |
| |
close(sock); |
| return NULL; |
return NULL; |
| } |
} |
| |
|