version 1.29, 2016/08/08 13:21:13
|
version 1.30.2.5, 2024/02/26 12:49:55
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004 - 2016 | Copyright 2004 - 2024 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 387 rxPacket(sched_task_t *task)
|
Line 387 rxPacket(sched_task_t *task)
|
schedEvent(TASK_ROOT(task), execCall, TASK_ARG(task), (int) noreply, rpc, len); |
schedEvent(TASK_ROOT(task), execCall, TASK_ARG(task), (int) noreply, rpc, len); |
err: |
err: |
/* send RPC reply */ |
/* send RPC reply */ |
if (!noreply) | if (!noreply && (rpc->call_io & RPC_REQ)) |
schedWrite(TASK_ROOT(task), cbProto[s->srv_proto][CB_TXPACKET], |
schedWrite(TASK_ROOT(task), cbProto[s->srv_proto][CB_TXPACKET], |
TASK_ARG(task), TASK_FD(task), rpc, len); |
TASK_ARG(task), TASK_FD(task), rpc, len); |
|
|
Line 424 acceptClients(sched_task_t *task)
|
Line 424 acceptClients(sched_task_t *task)
|
AIT_FREE_VAL(&c->cli_buf); |
AIT_FREE_VAL(&c->cli_buf); |
array_Del(srv->srv_clients, c->cli_id, 42); |
array_Del(srv->srv_clients, c->cli_id, 42); |
goto end; |
goto end; |
} else | } else { |
fcntl(c->cli_sock, F_SETFL, fcntl(c->cli_sock, F_GETFL) | O_NONBLOCK); |
fcntl(c->cli_sock, F_SETFL, fcntl(c->cli_sock, F_GETFL) | O_NONBLOCK); |
|
fcntl(c->cli_sock, F_SETFD, FD_CLOEXEC); |
|
} |
|
|
#ifdef TCP_SESSION_TIMEOUT |
#ifdef TCP_SESSION_TIMEOUT |
/* armed timer for close stateless connection */ |
/* armed timer for close stateless connection */ |
Line 542 rxUDPPacket(sched_task_t *task)
|
Line 544 rxUDPPacket(sched_task_t *task)
|
/* check integrity of packet */ |
/* check integrity of packet */ |
crc = ntohs(rpc->call_crc); |
crc = ntohs(rpc->call_crc); |
rpc->call_crc ^= rpc->call_crc; |
rpc->call_crc ^= rpc->call_crc; |
if (crc != crcFletcher16((u_short*) rpc, len / 2)) | if (crc != crcFletcher16((u_short*) AIT_GET_BUF(&b), len / 2)) |
goto end; |
goto end; |
|
|
/* check RPC packet session info */ |
/* check RPC packet session info */ |
Line 573 rxUDPPacket(sched_task_t *task)
|
Line 575 rxUDPPacket(sched_task_t *task)
|
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
|
|
/* send RPC reply */ |
/* send RPC reply */ |
if (!noreply) | if (!noreply && (rpc->call_io & RPC_REQ)) |
schedWrite(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
schedWrite(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
c, TASK_FD(task), rpc, len); |
c, TASK_FD(task), rpc, len); |
end: |
end: |
Line 706 rxRAWPacket(sched_task_t *task)
|
Line 708 rxRAWPacket(sched_task_t *task)
|
/* check integrity of packet */ |
/* check integrity of packet */ |
crc = ntohs(rpc->call_crc); |
crc = ntohs(rpc->call_crc); |
rpc->call_crc ^= rpc->call_crc; |
rpc->call_crc ^= rpc->call_crc; |
if (crc != crcFletcher16((u_short*) rpc, len / 2)) | if (crc != crcFletcher16((u_short*) AIT_GET_BUF(&b), len / 2)) |
goto end; |
goto end; |
|
|
/* check RPC packet session info */ |
/* check RPC packet session info */ |
Line 737 rxRAWPacket(sched_task_t *task)
|
Line 739 rxRAWPacket(sched_task_t *task)
|
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
|
|
/* send RPC reply */ |
/* send RPC reply */ |
if (!noreply) | if (!noreply && (rpc->call_io & RPC_REQ)) |
schedWrite(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
schedWrite(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
c, TASK_FD(task), rpc, len); |
c, TASK_FD(task), rpc, len); |
end: |
end: |
Line 907 rxBPFPacket(sched_task_t *task)
|
Line 909 rxBPFPacket(sched_task_t *task)
|
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
|
|
/* send RPC reply */ |
/* send RPC reply */ |
if (!noreply) | if (!noreply && (rpc->call_io & RPC_REQ)) |
schedEvent(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
schedEvent(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
c, TASK_FD(task), rpc, len); |
c, TASK_FD(task), rpc, len); |
end: |
end: |
Line 1037 rxEXTPacket(sched_task_t *task)
|
Line 1039 rxEXTPacket(sched_task_t *task)
|
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
schedEvent(TASK_ROOT(task), execCall, c, (int) noreply, rpc, len); |
|
|
/* send RPC reply */ |
/* send RPC reply */ |
if (!noreply) | if (!noreply && (rpc->call_io & RPC_REQ)) |
schedWrite(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
schedWrite(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], |
c, TASK_FD(task), rpc, len); |
c, TASK_FD(task), rpc, len); |
end: |
end: |
Line 1264 acceptBLOBClients(sched_task_t *task)
|
Line 1266 acceptBLOBClients(sched_task_t *task)
|
setsockopt(c->cli_sock, IPPROTO_TCP, TCP_NOPUSH, &n, sizeof n); |
setsockopt(c->cli_sock, IPPROTO_TCP, TCP_NOPUSH, &n, sizeof n); |
#endif |
#endif |
fcntl(c->cli_sock, F_SETFL, fcntl(c->cli_sock, F_GETFL) | O_NONBLOCK); |
fcntl(c->cli_sock, F_SETFL, fcntl(c->cli_sock, F_GETFL) | O_NONBLOCK); |
|
fcntl(c->cli_sock, F_SETFD, FD_CLOEXEC); |
} |
} |
|
|
schedRead(TASK_ROOT(task), rxBLOB, c, c->cli_sock, NULL, 0); |
schedRead(TASK_ROOT(task), rxBLOB, c, c->cli_sock, NULL, 0); |
Line 1555 rpc_srv_initServer(u_char InstID, int concurentClients
|
Line 1558 rpc_srv_initServer(u_char InstID, int concurentClients
|
pthread_mutex_destroy(&srv->srv_funcs.mtx); |
pthread_mutex_destroy(&srv->srv_funcs.mtx); |
e_free(srv); |
e_free(srv); |
return NULL; |
return NULL; |
} | } else |
| schedSignalDispatch(srv->srv_root, 42); |
|
|
/* init pool for clients */ |
/* init pool for clients */ |
srv->srv_clients = array_Init(concurentClients); |
srv->srv_clients = array_Init(concurentClients); |
Line 1677 rpc_srv_loopServer(rpc_srv_t * __restrict srv)
|
Line 1681 rpc_srv_loopServer(rpc_srv_t * __restrict srv)
|
schedPolling(srv->srv_root, &ts, NULL); |
schedPolling(srv->srv_root, &ts, NULL); |
/* main rpc loop */ |
/* main rpc loop */ |
schedRun(srv->srv_root, &srv->srv_kill); |
schedRun(srv->srv_root, &srv->srv_kill); |
|
schedSignalDispatch(srv->srv_root, 0); |
|
|
/* close all clients connections & server socket */ |
/* close all clients connections & server socket */ |
for (i = 0; i < array_Size(srv->srv_clients); i++) { |
for (i = 0; i < array_Size(srv->srv_clients); i++) { |
Line 1815 rpc_srv_initServer2(u_char InstID, int concurentClient
|
Line 1820 rpc_srv_initServer2(u_char InstID, int concurentClient
|
pthread_mutex_destroy(&srv->srv_funcs.mtx); |
pthread_mutex_destroy(&srv->srv_funcs.mtx); |
e_free(srv); |
e_free(srv); |
return NULL; |
return NULL; |
} | } else |
| schedSignalDispatch(srv->srv_root, 42); |
|
|
/* init pool for clients */ |
/* init pool for clients */ |
srv->srv_clients = array_Init(concurentClients); |
srv->srv_clients = array_Init(concurentClients); |
Line 1933 rpc_srv_initServerExt(u_char InstID, int netBuf, int f
|
Line 1939 rpc_srv_initServerExt(u_char InstID, int netBuf, int f
|
pthread_mutex_destroy(&srv->srv_funcs.mtx); |
pthread_mutex_destroy(&srv->srv_funcs.mtx); |
e_free(srv); |
e_free(srv); |
return NULL; |
return NULL; |
} | } else |
| schedSignalDispatch(srv->srv_root, 42); |
|
|
/* init pool for clients */ |
/* init pool for clients */ |
srv->srv_clients = array_Init(1); |
srv->srv_clients = array_Init(1); |