libgnunetchat

library for GNUnet Messenger
Log | Files | Refs | README | LICENSE

commit 7dcf5b56a5d5315a94e2f4c325be1f89d86e7729
parent e9081a700fc49b6b53746e001000065519cc939c
Author: Jacki <jacki@thejackimonster.de>
Date:   Tue, 23 Apr 2024 00:25:49 +0200

Avoid duplicate ticket storage

Signed-off-by: Jacki <jacki@thejackimonster.de>

Diffstat:
Msrc/gnunet_chat_handle_intern.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c @@ -839,7 +839,20 @@ skip_msg_handing: } case GNUNET_MESSENGER_KIND_TICKET: { - struct GNUNET_CHAT_InternalTickets *tickets = GNUNET_new( + struct GNUNET_CHAT_InternalTickets *tickets = contact->tickets_head; + while (tickets) + { + if (0 == GNUNET_memcmp(&(tickets->ticket->ticket.rnd), + &(message->msg->body.ticket.identifier))) + break; + + tickets = tickets->next; + } + + if (tickets) + break; + + tickets = GNUNET_new( struct GNUNET_CHAT_InternalTickets );