summaryrefslogtreecommitdiff
path: root/ecp
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-05-03 20:18:09 +0200
committerUros Majstorovic <majstor@majstor.org>2024-05-03 20:18:09 +0200
commitb051b3abdc70976cbbe4682141a4b9239f10a8bf (patch)
tree9c4e14a80bbe886d13a83a068e3ef21e1b52b496 /ecp
parentbcbcf079787bb37277769738a2edbaaee63f44c4 (diff)
fixed connection expiry in gc
Diffstat (limited to 'ecp')
-rw-r--r--ecp/src/ecp/core.c10
-rw-r--r--ecp/src/ecp/core.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/ecp/src/ecp/core.c b/ecp/src/ecp/core.c
index 7166a44..a049bb7 100644
--- a/ecp/src/ecp/core.c
+++ b/ecp/src/ecp/core.c
@@ -376,7 +376,7 @@ static ECPConnection *conn_table_search(ECPSocket *sock, unsigned char c_idx, ec
return NULL;
}
-static void conn_table_expire(ECPSocket *sock, ecp_sts_t to, ecp_conn_expired_t conn_expired) {
+static void conn_table_expire(ECPSocket *sock, ecp_conn_expired_t conn_expired) {
ECPConnection *conn;
ECPConnection *to_remove[ECP_MAX_EXPIRED];
int i, remove_cnt, expired;
@@ -410,7 +410,7 @@ static void conn_table_expire(ECPSocket *sock, ecp_sts_t to, ecp_conn_expired_t
pthread_mutex_lock(&conn->mutex);
#endif
- expired = conn_expired(conn, now, to);
+ expired = conn_expired(conn, now);
#ifdef ECP_WITH_PTHREAD
pthread_mutex_unlock(&conn->mutex);
@@ -461,7 +461,7 @@ static void conn_table_expire(ECPSocket *sock, ecp_sts_t to, ecp_conn_expired_t
#endif
expired = 0;
- if (_ecp_conn_in_gct(conn)) expired = conn_expired(conn, now, to);
+ if (_ecp_conn_in_gct(conn)) expired = conn_expired(conn, now);
if (expired) _ecp_conn_pull_gct(conn);
#ifdef ECP_WITH_PTHREAD
@@ -639,8 +639,8 @@ int ecp_sock_dhkey_get_pub(ECPSocket *sock, unsigned char *idx, ecp_ecdh_public_
return ECP_OK;
}
-void ecp_sock_expire(ECPSocket *sock, ecp_sts_t to, ecp_conn_expired_t conn_expired) {
- conn_table_expire(sock, to, conn_expired);
+void ecp_sock_expire(ECPSocket *sock, ecp_conn_expired_t conn_expired) {
+ conn_table_expire(sock, conn_expired);
}
void ecp_atag_gen(ECPSocket *sock, unsigned char *public_buf, unsigned char *atag, ecp_nonce_t *nonce) {
diff --git a/ecp/src/ecp/core.h b/ecp/src/ecp/core.h
index 4d4c38a..62c1de3 100644
--- a/ecp/src/ecp/core.h
+++ b/ecp/src/ecp/core.h
@@ -224,7 +224,7 @@ struct ECPFragIter;
#include "transport.h"
#include "timer.h"
-typedef int (*ecp_conn_expired_t) (struct ECPConnection *conn, ecp_sts_t now, ecp_sts_t to);
+typedef int (*ecp_conn_expired_t) (struct ECPConnection *conn, ecp_sts_t now);
typedef void (*ecp_err_handler_t) (struct ECPConnection *conn, unsigned char mtype, int err);
typedef struct ECPConnection * (*ecp_conn_new_t) (struct ECPSocket *sock, unsigned char type);
@@ -396,7 +396,7 @@ void ecp_sock_ckey_new(ECPSocket *sock);
int ecp_sock_dhkey_new(ECPSocket *sock);
int ecp_sock_dhkey_get(ECPSocket *sock, unsigned char idx, ECPDHKey *key);
int ecp_sock_dhkey_get_pub(ECPSocket *sock, unsigned char *idx, ecp_ecdh_public_t *public);
-void ecp_sock_expire(ECPSocket *sock, ecp_sts_t to, ecp_conn_expired_t conn_expired);
+void ecp_sock_expire(ECPSocket *sock, ecp_conn_expired_t conn_expired);
void ecp_atag_gen(ECPSocket *sock, unsigned char *public_buf, unsigned char *atag, ecp_nonce_t *nonce);
int ecp_cookie_verify(ECPSocket *sock, unsigned char *cookie, unsigned char *public_buf);